Selaa lähdekoodia

Checkin des kompletten Sources

git-svn-id: svn://svn.siningsoft.de/e85mixcalc@3 05c655e9-1891-44bb-bfc1-56e73731d8b6
devnull 11 vuotta sitten
vanhempi
sitoutus
cd6ce5d8f3
35 muutettua tiedostoa jossa 566 lisäystä ja 0 poistoa
  1. 17 0
      AndroidManifest.xml
  2. BIN
      CalcDemo.jar
  3. BIN
      E85-MixCalc.apk
  4. 17 0
      bin/AndroidManifest.xml
  5. BIN
      bin/classes/com/siningsoft/e85mixcalc/BuildConfig.class
  6. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$attr.class
  7. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$color.class
  8. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$dimen.class
  9. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$drawable.class
  10. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$id.class
  11. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$layout.class
  12. BIN
      bin/classes/com/siningsoft/e85mixcalc/R$string.class
  13. BIN
      bin/classes/com/siningsoft/e85mixcalc/R.class
  14. BIN
      bin/classes/com/siningsoft/e85mixcalc/main$1.class
  15. BIN
      bin/classes/com/siningsoft/e85mixcalc/main$2.class
  16. BIN
      bin/classes/com/siningsoft/e85mixcalc/main$3.class
  17. BIN
      bin/classes/com/siningsoft/e85mixcalc/main$4.class
  18. BIN
      bin/classes/com/siningsoft/e85mixcalc/main$5.class
  19. BIN
      bin/classes/com/siningsoft/e85mixcalc/main.class
  20. 3 0
      bin/jarlist.cache
  21. 6 0
      gen/com/siningsoft/e85mixcalc/BuildConfig.java
  22. 57 0
      gen/com/siningsoft/e85mixcalc/R.java
  23. 3 0
      lint.xml
  24. 14 0
      project.properties
  25. BIN
      res/drawable-hdpi/icon.png
  26. BIN
      res/drawable-hdpi/logo_06.png
  27. BIN
      res/drawable-hdpi/logo_top.png
  28. BIN
      res/drawable-ldpi/icon.png
  29. BIN
      res/drawable-mdpi/icon.png
  30. 112 0
      res/layout/main.xml
  31. 5 0
      res/values/colors.xml
  32. 4 0
      res/values/dimens.xml
  33. 18 0
      res/values/strings.xml
  34. 310 0
      src/com/siningsoft/e85mixcalc/main.java
  35. BIN
      tmp/E85.jpg

+ 17 - 0
AndroidManifest.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.siningsoft.e85mixcalc"
+      android:installLocation="auto" android:versionName="@string/VersionName" android:versionCode="8">
+    <application android:icon="@drawable/icon" android:label="@string/app_name" android:description="@string/description" android:persistent="false">
+        <activity android:name=".main"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="20"/>
+
+</manifest> 

BIN
CalcDemo.jar


BIN
E85-MixCalc.apk


+ 17 - 0
bin/AndroidManifest.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.siningsoft.e85mixcalc"
+      android:installLocation="auto" android:versionName="@string/VersionName" android:versionCode="8">
+    <application android:icon="@drawable/icon" android:label="@string/app_name" android:description="@string/description" android:persistent="false">
+        <activity android:name=".main"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="20"/>
+
+</manifest> 

BIN
bin/classes/com/siningsoft/e85mixcalc/BuildConfig.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$attr.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$color.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$dimen.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$drawable.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$id.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$layout.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R$string.class


BIN
bin/classes/com/siningsoft/e85mixcalc/R.class


BIN
bin/classes/com/siningsoft/e85mixcalc/main$1.class


BIN
bin/classes/com/siningsoft/e85mixcalc/main$2.class


BIN
bin/classes/com/siningsoft/e85mixcalc/main$3.class


BIN
bin/classes/com/siningsoft/e85mixcalc/main$4.class


BIN
bin/classes/com/siningsoft/e85mixcalc/main$5.class


BIN
bin/classes/com/siningsoft/e85mixcalc/main.class


+ 3 - 0
bin/jarlist.cache

@@ -0,0 +1,3 @@
+# cache for current jar dependency. DO NOT EDIT.
+# format is <lastModified> <length> <SHA-1> <path>
+# Encoding is UTF-8

+ 6 - 0
gen/com/siningsoft/e85mixcalc/BuildConfig.java

@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.siningsoft.e85mixcalc;
+
+public final class BuildConfig {
+    public final static boolean DEBUG = true;
+}

+ 57 - 0
gen/com/siningsoft/e85mixcalc/R.java

@@ -0,0 +1,57 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.siningsoft.e85mixcalc;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class color {
+        public static final int green=0x7f040000;
+    }
+    public static final class dimen {
+        public static final int bigTextValues=0x7f050000;
+    }
+    public static final class drawable {
+        public static final int icon=0x7f020000;
+        public static final int logo_06=0x7f020001;
+        public static final int logo_top=0x7f020002;
+    }
+    public static final class id {
+        public static final int ProgLogo=0x7f070000;
+        public static final int bac_enter_affair=0x7f070009;
+        public static final int bac_enter_full=0x7f07000a;
+        public static final int calcbutton=0x7f07000b;
+        public static final int for_enter_bio=0x7f070008;
+        public static final int for_enter_super=0x7f070007;
+        public static final int rbETHANOL=0x7f070004;
+        public static final int rbMODE=0x7f070001;
+        public static final int rbbac=0x7f070003;
+        public static final int rbe10=0x7f070006;
+        public static final int rbe5=0x7f070005;
+        public static final int rbfor=0x7f070002;
+    }
+    public static final class layout {
+        public static final int main=0x7f030000;
+    }
+    public static final class string {
+        public static final int VersionName=0x7f06000d;
+        public static final int allenterless=0x7f060006;
+        public static final int app_name=0x7f060000;
+        public static final int button_bac=0x7f060008;
+        public static final int button_calc=0x7f060005;
+        public static final int button_for=0x7f060007;
+        public static final int description=0x7f060004;
+        public static final int e10=0x7f06000b;
+        public static final int e5=0x7f06000a;
+        public static final int enter_affair=0x7f060003;
+        public static final int enter_bio=0x7f060002;
+        public static final int enter_full=0x7f06000c;
+        public static final int enter_super=0x7f060001;
+        public static final int result=0x7f060009;
+    }
+}

+ 3 - 0
lint.xml

@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+</lint>

+ 14 - 0
project.properties

@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-10

BIN
res/drawable-hdpi/icon.png


BIN
res/drawable-hdpi/logo_06.png


BIN
res/drawable-hdpi/logo_top.png


BIN
res/drawable-ldpi/icon.png


BIN
res/drawable-mdpi/icon.png


+ 112 - 0
res/layout/main.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    		 android:layout_width="fill_parent" 
+    		 android:layout_height="fill_parent">
+
+	<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+		android:layout_height="fill_parent"
+	    android:scrollbars="vertical"
+	    android:scrollbarStyle="outsideOverlay" 
+	    android:layout_width="match_parent" 
+	    android:orientation="vertical">
+	    
+	<ImageView android:id="@+id/ProgLogo" 
+			   android:layout_width="wrap_content" 
+			   android:layout_height="wrap_content"
+			   android:src="@drawable/logo_top"
+			   android:layout_gravity="center_horizontal">
+	</ImageView>
+	
+	<RadioGroup android:id="@+id/rbMODE" 
+				android:layout_width="fill_parent" 
+				android:layout_height="wrap_content"
+				android:orientation="horizontal"
+				android:gravity="center">
+	    
+	    		<RadioButton android:layout_width="wrap_content" 
+	    					 android:layout_height="wrap_content" 
+	    					 android:text="@string/button_for" 
+	    					 android:id="@+id/rbfor" 
+	    					 android:checked="true"
+	    					 android:gravity="center|left"
+	    					 android:layout_weight="1"/>
+	    					 
+	    		<RadioButton android:layout_width="wrap_content" 
+	    					 android:layout_height="wrap_content" 
+	    					 android:text="@string/button_bac" 
+	    					 android:id="@+id/rbbac"
+	    					 android:gravity="center|left"
+	    					 android:layout_weight="2"/>
+	</RadioGroup>
+	
+	<RadioGroup android:id="@+id/rbETHANOL" 
+				android:layout_width="fill_parent" 
+				android:layout_height="wrap_content" 
+				android:orientation="horizontal"
+				android:gravity="center">
+				
+				
+	    		<RadioButton android:text="@string/e5" 
+	    					 android:id="@+id/rbe5" 
+	    					 android:layout_width="wrap_content" 
+	    					 android:layout_height="wrap_content" 
+	    					 android:checked="true"   					 
+	    					 android:gravity="center|left"
+	    					 android:layout_weight="1"/>
+	    					 
+	    		<RadioButton android:text="@string/e10" 
+	    					 android:id="@+id/rbe10" 
+	    					 android:layout_width="wrap_content" 
+	    					 android:layout_height="wrap_content"
+							 android:gravity="center|left"
+	    					 android:layout_weight="2"
+	    					 android:checked="true"/>
+	</RadioGroup>
+	
+	<EditText
+	    android:id="@+id/for_enter_super"
+	    android:layout_width="fill_parent"
+	    android:layout_height="wrap_content"
+	    android:hint="@string/enter_super"
+	    android:numeric="decimal"
+	    android:textSize="@dimen/bigTextValues"
+	    android:textStyle="bold" />
+	
+	<EditText
+	    android:id="@+id/for_enter_bio"
+	    android:layout_width="fill_parent"
+	    android:layout_height="wrap_content"
+	    android:hint="@string/enter_bio"
+	    android:numeric="decimal"
+	    android:textSize="@dimen/bigTextValues"
+	    android:textStyle="bold" />
+	
+	<EditText
+	    android:id="@+id/bac_enter_affair"
+	    android:layout_width="fill_parent"
+	    android:layout_height="wrap_content"
+	    android:enabled="false"
+	    android:hint="@string/enter_affair"
+	    android:numeric="integer|decimal"
+	    android:textColor="@color/green"
+	    android:textSize="@dimen/bigTextValues"
+	    android:textStyle="bold" />
+			  
+	<EditText
+	    android:id="@+id/bac_enter_full"
+	    android:layout_width="match_parent"
+	    android:layout_height="wrap_content"
+	    android:enabled="false"
+	    android:hint="@string/enter_full"
+	    android:numeric="integer|decimal"
+	    android:textColor="@color/green"
+	    android:textSize="@dimen/bigTextValues"
+	    android:textStyle="bold" />
+	
+	<Button android:text="@string/button_calc" 
+			android:id="@+id/calcbutton" 
+			android:layout_width="match_parent" 
+			android:layout_height="wrap_content"/>
+	
+	</LinearLayout>
+ </ScrollView>

+ 5 - 0
res/values/colors.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="green">#469921</color>
+    
+</resources>

+ 4 - 0
res/values/dimens.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <dimen name="bigTextValues">12pt</dimen>
+</resources>

+ 18 - 0
res/values/strings.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    
+    <string name="app_name">E85-MixCalc</string>
+<string name="enter_super">Liter Super Benzin</string>
+<string name="enter_bio">Liter E85</string>
+<string name="enter_affair">Mischverhältnis in %</string>
+<string name="description">Diese App berechnet das E85 zu Super Mischverhältnis.</string>
+<string name="button_calc">berechnen</string>
+<string name="allenterless">zu wenig Werte</string>
+<string name="button_for">Vor</string>
+<string name="button_bac">Zurück</string>
+<string name="result">Ergebnis</string>
+<string name="e5">E5</string>
+<string name="e10">E10</string>
+<string name="enter_full">Liter Gesamtmenge</string>
+<string name="VersionName">Final Beta 2</string>
+</resources>

+ 310 - 0
src/com/siningsoft/e85mixcalc/main.java

@@ -0,0 +1,310 @@
+package com.siningsoft.e85mixcalc;
+
+import android.app.Activity;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.RadioButton;
+import android.widget.Toast;
+
+public class main extends Activity {
+    /** Called when the activity is first created. */
+
+	//noch schnell ein paar Variablen definieren
+	double ethanolInhaltS = 0.10;
+	String ethanolInhaltST = "E10";
+	int mode = 0;
+	
+
+	
+	@Override
+    public void onCreate(Bundle savedInstanceState) {
+        
+    	super.onCreate(savedInstanceState);
+ 	
+    	setContentView(R.layout.main);
+                       
+        Button calcbutton = (Button) findViewById(R.id.calcbutton);
+        calcbutton.setOnClickListener(calcbuttonlistener);
+       
+        //vorwaertskalkulation
+        RadioButton rbfor = (RadioButton)findViewById(R.id.rbfor);
+        rbfor.setOnClickListener(rbforL);
+                
+        //rueckwaertskalkulation
+        RadioButton rbbac = (RadioButton)findViewById(R.id.rbbac);
+        rbbac.setOnClickListener(rbbacL);
+                
+        //5 Prozent Ethanol im Super
+        RadioButton rbe5 = (RadioButton)findViewById(R.id.rbe5);
+        rbe5.setOnClickListener(rbe5L);
+                
+        //10 Prozent Ethanol im Super
+        RadioButton rbe10 = (RadioButton)findViewById(R.id.rbe10);
+        rbe10.setOnClickListener(rbe10L);
+        
+    }
+    
+    public OnClickListener rbforL = new OnClickListener() {
+		
+		@Override
+		public void onClick(View v) {
+			//Vorwärtskalkulation deaktiviert die Rückwärtsfelder und verwendet sie als Ausgabefelder
+			((EditText)findViewById(R.id.bac_enter_affair)).setEnabled(false);
+			((EditText)findViewById(R.id.bac_enter_affair)).setTextColor(getResources().getColorStateList(R.color.green));
+			
+			((EditText)findViewById(R.id.bac_enter_affair)).setText("");
+			
+			((EditText)findViewById(R.id.bac_enter_full)).setEnabled(false);
+			((EditText)findViewById(R.id.bac_enter_full)).setTextColor(getResources().getColorStateList(R.color.green));
+			
+			((EditText)findViewById(R.id.bac_enter_full)).setText("");
+			
+			//Vorwärtskalkulation aktiviert alle vorwärtsfelder
+			((EditText)findViewById(R.id.for_enter_bio)).setEnabled(true);
+			((EditText)findViewById(R.id.for_enter_bio)).setTextColor(Color.parseColor("#000000"));
+			((EditText)findViewById(R.id.for_enter_bio)).setText("");
+			
+			((EditText)findViewById(R.id.for_enter_super)).setEnabled(true);
+			((EditText)findViewById(R.id.for_enter_super)).setTextColor(Color.parseColor("#000000"));
+			((EditText)findViewById(R.id.for_enter_super)).setText("");
+			
+			//a = vorwärts
+			mode = 0;
+			
+			Log.i("Berechnungsmodus", "Vorwärts");
+		}
+	}; 
+    
+	public OnClickListener rbbacL = new OnClickListener() {
+		
+		@Override
+		public void onClick(View v) {
+			//Rückwärtskalkulation  deaktiviert alle vorwärtsfelder
+			((EditText)findViewById(R.id.for_enter_bio)).setEnabled(false);
+			((EditText)findViewById(R.id.for_enter_bio)).setTextColor(getResources().getColorStateList(R.color.green));
+			
+			((EditText)findViewById(R.id.for_enter_bio)).setText("");
+			
+			((EditText)findViewById(R.id.for_enter_super)).setEnabled(false);
+			((EditText)findViewById(R.id.for_enter_super)).setTextColor(getResources().getColorStateList(R.color.green));
+			
+			((EditText)findViewById(R.id.for_enter_super)).setText("");
+			
+			((EditText)findViewById(R.id.bac_enter_affair)).setEnabled(true);
+			((EditText)findViewById(R.id.bac_enter_affair)).setTextColor(Color.parseColor("#000000"));
+			((EditText)findViewById(R.id.bac_enter_affair)).setText("");
+			
+			((EditText)findViewById(R.id.bac_enter_full)).setEnabled(true);
+			((EditText)findViewById(R.id.bac_enter_full)).setTextColor(Color.parseColor("#000000"));
+			((EditText)findViewById(R.id.bac_enter_full)).setText("");
+			
+			//b = rückwärts
+			mode = 1;
+			
+			Log.i("Berechnungsmodus", "Rückwärts");
+			
+		}
+	};
+	
+	public OnClickListener rbe5L = new OnClickListener() {
+		
+		@Override
+		public void onClick(View v) {
+			// Wenn dieser Butten geclickt wird, verwenden wir 5 Prozent Ethanol
+			ethanolInhaltS = 0.05;
+			ethanolInhaltST = "E5";
+			
+			Log.i("Supersorte", ethanolInhaltST);
+		
+		}
+	}; 
+	
+	public OnClickListener rbe10L = new OnClickListener() {
+		
+		@Override
+		public void onClick(View v) {
+			// Wenn dieser Butten geclickt wird, verwenden wir 10 Prozent Ethanol
+			ethanolInhaltS = 0.10;
+			ethanolInhaltST = "E10";
+			
+			Log.i("Supersorte", ethanolInhaltST);
+			
+		}
+	}; 
+	
+    
+    public OnClickListener calcbuttonlistener = new OnClickListener() {
+    	
+    	@Override
+		public void onClick(View v) {
+			/*der Code fuer den gedrueckten button
+			 * wir weisen die Inhalte der Edit-Texts Variablen zu
+			 */
+    		
+    		//wir nullen die Berechnungswerte
+    		Double v_super = 0.0;
+    		Double v_bio = 0.0;
+    		Double v_affair = 0.0;
+    		Double v_full = 0.0;
+    		Double a_ethanol = 0.0;
+    		Double a_super = 0.0;
+    		Double r_ethanol = 0.0; 
+    		int sammelcnt = 0;
+    		
+    		switch (mode)
+    		{
+    			//diese switch klausel prueft, ob die Werte fuer die berechnung eingegeben wurden.
+    			case 0:
+		    	
+    				//abfrage, ob eingabewert leer oder keine Zahl
+		    		if (String.valueOf(((EditText) findViewById(R.id.for_enter_super)).getText()).length() > 0)
+		    		{    			
+		    			v_super = Double.parseDouble(String.valueOf(((EditText) findViewById(R.id.for_enter_super)).getText()));
+		    			sammelcnt ++;
+		    		}
+		    		
+		    		
+		    		if (String.valueOf(((EditText) findViewById(R.id.for_enter_bio)).getText()).length() > 0)
+		    		{
+		    			v_bio = Double.parseDouble(String.valueOf(((EditText) findViewById(R.id.for_enter_bio)).getText()));
+		    			sammelcnt ++;
+		    		}
+		    		
+		    	break;
+		    	
+    			case 1:
+    				
+    				//abfrage, ob eingabewert leer oder keine Zahl
+		    		if (String.valueOf(((EditText) findViewById(R.id.bac_enter_affair)).getText()).length() > 0)
+		    		{    			
+		    			v_affair = Double.parseDouble(String.valueOf(((EditText) findViewById(R.id.bac_enter_affair)).getText()));
+		    			sammelcnt ++;
+		    		}
+		    		
+		    		
+		    		if (String.valueOf(((EditText) findViewById(R.id.bac_enter_full)).getText()).length() > 0)
+		    		{
+		    			v_full = Double.parseDouble(String.valueOf(((EditText) findViewById(R.id.bac_enter_full)).getText()));
+		    			sammelcnt ++;
+		    		}
+		    		
+    			break;
+    		
+    		}
+    		
+			
+			/*1. es muss immer ein feld leer sein und das wird dann berechnet
+			 * also wird als erstes geprueft, ob alle felder belegt sind, wenn nicht, dann geht es weiter
+			 * sonst gibt es einen Toast
+			 */
+			
+			Log.d("calc", v_super.toString());
+			Log.d("calc", v_bio.toString());
+			Log.d("calc", v_affair.toString());
+			
+			
+			switch (sammelcnt)
+			{
+				case 0:
+					//keine Werte
+					Toast.makeText(v.getContext(), R.string.allenterless , Toast.LENGTH_SHORT).show();
+				break;
+				
+				case 1:
+					//zu wenig werte
+					Toast.makeText(v.getContext(), R.string.allenterless , Toast.LENGTH_SHORT).show();
+				break;
+				
+				case 2:
+					//genau richtig ab hier wird gerechnet
+					
+				
+					switch (mode)
+					{
+						
+						case 0:
+							
+							// errechnen gesamtmenge an Ethanol 
+							a_ethanol = (v_super * ethanolInhaltS) + (v_bio * 0.85);
+							Log.i("absolut ethanol in Liter", a_ethanol.toString());
+							
+							a_super = (v_super * (1-ethanolInhaltS)) + (v_bio * 0.15);
+							Log.i("absolut super in Liter", a_super.toString());
+
+
+							//Berechnung Gemischverhaeltnis anhand Spritmengen
+							if ( v_super > 0.0 && v_bio > 0.0)
+							{
+					        	//relativer Alkoholanteil								
+								r_ethanol = (a_ethanol * 100) / (v_super + v_bio);
+								v_full = v_super + v_bio;
+								
+								Log.i("relativ ethanol in Prozent", r_ethanol.toString());
+								
+								((EditText)findViewById(R.id.bac_enter_affair)).setText("E" + String.valueOf(Math.round(r_ethanol)));
+								((EditText)findViewById(R.id.bac_enter_full)).setText(v_full.toString() + " l");
+								
+							}
+							
+						break;
+						
+						case 1:
+							
+							Boolean calcdone = false;
+							Double calc_a_super = v_full;
+							Double calc_a_bio = 0.0;
+							
+							//rueckwärtsrechnung gemischverhältnis und gesamtmenge
+					        while ( calcdone == false )
+					        {
+					           
+								// errechnen gesamtmenge an Ethanol 
+								a_ethanol = (calc_a_super * ethanolInhaltS) + (calc_a_bio * 0.85);
+								//Log.i("absolut ethanol in Liter", a_ethanol.toString());
+								
+
+					        	//relativer Alkoholanteil
+					            r_ethanol = (a_ethanol * 100) / v_full;
+					            //Log.i("relativ ethanol in prozent", r_ethanol.toString());
+
+
+					            if (Math.round(r_ethanol) != Math.round(v_affair) && r_ethanol < 100.0) //errechneter Anteil ist ungleich dem gewünschten
+					            {
+					                calc_a_super = calc_a_super - 0.01; //super - 0.01
+					                calc_a_bio = calc_a_bio + 0.01; //bio + 0.01
+
+					            }
+					            else
+					            {
+					            	//hier nur ausgabe
+					                
+					                Log.i("E5 in Liter",String.valueOf(Math.round(calc_a_super)));
+					                Log.i("E85 in Liter",String.valueOf(Math.round(calc_a_bio)));
+					                
+					                ((EditText)findViewById(R.id.for_enter_super)).setText(String.valueOf(Math.round(calc_a_super)) + " l " + ethanolInhaltST);          
+					                ((EditText)findViewById(R.id.for_enter_bio)).setText(String.valueOf(Math.round(calc_a_bio)) + " l E85");
+					                
+					                calcdone = true;
+					            }
+					        }
+							
+							
+						break;
+					}
+					
+				break;
+				
+						
+			}
+			
+	
+		}
+	};
+	
+    
+}

BIN
tmp/E85.jpg