Skip to content

Commit

Permalink
Merge pull request #18 from SirkoVZ/UUIDCopyable
Browse files Browse the repository at this point in the history
Version 0.8.9
  • Loading branch information
SirkoVZ authored Oct 20, 2016
2 parents 9785836 + ddc2048 commit 05dead4
Show file tree
Hide file tree
Showing 16 changed files with 308 additions and 209 deletions.
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ App Language: english, deutsch

Download: [https://github.com/volkszaehler/app-android/releases/latest](https://github.com/volkszaehler/app-android/releases/latest "Latest Release")

![ScreenShot1](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/uebersicht.png "ScreenShots 1 of VolkszaehlerApp")
![ScreenShot2](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/details.png "ScreenShots 2 of VolkszaehlerApp")
![ScreenShot3](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/grafik.png "ScreenShots 3 of VolkszaehlerApp")
![ScreenShot4](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/einstellungen.png "ScreenShots 4 of VolkszaehlerApp")
![ScreenShot1](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/uebersicht.png?w=200&tok=2908a1 "ScreenShots 1 of VolkszaehlerApp")
![ScreenShot2](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/details.png?w=200&tok=60ff35 "ScreenShots 2 of VolkszaehlerApp")
![ScreenShot3](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/grafik.png?w=200&tok=3e01fa "ScreenShots 3 of VolkszaehlerApp")
![ScreenShot4](http://wiki.volkszaehler.org/_media/software/frontends/vz_app/einstellungen.png?w=200&tok=ede86f "ScreenShots 4 of VolkszaehlerApp")

## VolkszählerApp für Android, Version 0.8.8
## VolkszählerApp für Android, Version 0.8.9
---

Funktionen:
Expand All @@ -35,7 +35,7 @@ Wenn das Clonen bzw. das Öffnen des Projektes wegen eines ausgegrauten "Use def


English:
## VolkszaehlerApp for Android, Version 0.8.8
## VolkszaehlerApp for Android, Version 0.8.9
---

Features:
Expand All @@ -62,17 +62,28 @@ If the cloning resp. opening of the project fails due to a grayed "Use default g
###Version history:
---

###Version 0.8.8
###Version 0.8.9
####New
- It is now possible to have several graphs in one chart, use "Long Press" in chart view, Limitation: there is only one y-Axis
- ChannelDetails show now the total value if an initial value is set for the channel
- Number of Tuples can be set now (default is 1000), a higher number makes the Charts more detailled (as long as there are enough values in the database), but slows down the charts
- Private channels can be manually added in preferences, if there are more than one, add them comma separated like uuid1,uuid2,uuid3

####Fixed
- fixed display issues with Channels of type "water" and costs
- better error handling, works with older Volkszaehler version now

####Changed
- small optimizations ([Font Size](https://github.com/volkszaehler/app-android/issues/16), [Values can be copied](https://github.com/volkszaehler/app-android/issues/14))


###Version 0.8.8
####New
- It is now possible to have several graphs in one chart, use "Long Press" in chart view, Limitation: there is only one y-Axis
- ChannelDetails show now the total value if an initial value is set for the channel
- Number of Tuples can be set now (default is 1000), a higher number makes the Charts more detailled (as long as there are enough values in the database), but slows down the charts

####Fixed
- fixed display issues with Channels of type "water" and costs

####Changed
- small optimizations
- small optimizations

###Version 0.8.7
####Fixed
Expand All @@ -84,7 +95,7 @@ If the cloning resp. opening of the project fails due to a grayed "Use default g
###Version 0.8.6
####Fixed
- empty Channel Color causes crash
- Umlauts in host name causes crash
- Umlauts in host name cause crash

###Version 0.8.5
####Changed
Expand Down
16 changes: 8 additions & 8 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
Expand All @@ -80,6 +72,14 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
defaultConfig {
applicationId "org.volkszaehler.volkszaehlerapp"
minSdkVersion 14
targetSdkVersion 23
targetSdkVersion 24
}

compileOptions {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.volkszaehler.volkszaehlerapp"
android:versionCode="88"
android:versionName="0.8.8" >
android:versionCode="89"
android:versionName="0.8.9" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package org.volkszaehler.volkszaehlerapp;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
Expand All @@ -21,21 +17,24 @@
import android.widget.TextView;
import android.widget.Toast;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class ChannelDetails extends Activity {

private String mUUID = "";
private static Context myContext;
private ProgressDialog pDialog;
String unit;
String jsonStrGesamt ="";
boolean strom = false;
boolean gas = false;
boolean water = false;
boolean temp = false;
private String unit;
private String jsonStrGesamt ="";
private boolean strom = false;
private boolean gas = false;
private boolean water = false;
private boolean temp = false;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -113,8 +112,8 @@ public void onCreate(Bundle savedInstanceState) {
}
else {
// no cost
((TextView) findViewById(R.id.textViewTitleCost)).setVisibility(View.GONE);
((TextView) findViewById(R.id.textViewCost)).setVisibility(View.GONE);
findViewById(R.id.textViewTitleCost).setVisibility(View.GONE);
findViewById(R.id.textViewCost).setVisibility(View.GONE);
}
} catch (NumberFormatException nfe) {
Log.e("ChannelDetails", "strange costs: " + Tools.getPropertyOfChannel(myContext, mUUID, Tools.TAG_COST));
Expand Down Expand Up @@ -160,8 +159,8 @@ else if (!"".equals(jsonStrGesamt))
else
{
//remove consumption from dialog
((TextView) findViewById(R.id.textViewTitleGesamt)).setVisibility(View.GONE);
((TextView) findViewById(R.id.textViewGesamt)).setVisibility(View.GONE);
findViewById(R.id.textViewTitleGesamt).setVisibility(View.GONE);
findViewById(R.id.textViewGesamt).setVisibility(View.GONE);
}
}

Expand Down Expand Up @@ -198,31 +197,23 @@ protected String doInBackground(String... arg0) {
} else {
jsonStrGesamt = sh.makeServiceCall(urlDef, ServiceHandler.GET, null, uname, pwd);
}
if (jsonStrGesamt != null) {
if (!jsonStrGesamt.startsWith("{\"version\":\"0.3\",\"data")) {
JSONFehler = true;
fehlerAusgabe = jsonStrGesamt;
} else {
Log.d("ChannelDetails", "jsonStrGesamt: " + jsonStrGesamt);
try {
if (gas)
{
jsonStrGesamt = String.valueOf(Tools.f000.format(new JSONObject(jsonStrGesamt).getJSONObject(Tools.TAG_DATA).getDouble(Tools.TAG_CONSUMPTION) + Double.valueOf(arg0[0])));
}
else if (strom)
{
jsonStrGesamt = String.valueOf(Tools.f000.format((new JSONObject(jsonStrGesamt).getJSONObject(Tools.TAG_DATA).getDouble(Tools.TAG_CONSUMPTION) + Double.valueOf(arg0[0]) * 1000)/1000));
}
else if (water)
{
jsonStrGesamt = String.valueOf(Tools.f0.format(new JSONObject(jsonStrGesamt).getJSONObject(Tools.TAG_DATA).getDouble(Tools.TAG_CONSUMPTION) + Double.valueOf(arg0[0])));
}
} catch (JSONException je) {
Log.e("ChannelDetails", je.getMessage());

if (jsonStrGesamt.startsWith("Error: ")) {
JSONFehler = true;
fehlerAusgabe = jsonStrGesamt;
} else {
Log.d("ChannelDetails", "jsonStrGesamt: " + jsonStrGesamt);
try {
if (gas) {
jsonStrGesamt = String.valueOf(Tools.f000.format(new JSONObject(jsonStrGesamt).getJSONObject(Tools.TAG_DATA).getDouble(Tools.TAG_CONSUMPTION) + Double.valueOf(arg0[0])));
} else if (strom) {
jsonStrGesamt = String.valueOf(Tools.f000.format((new JSONObject(jsonStrGesamt).getJSONObject(Tools.TAG_DATA).getDouble(Tools.TAG_CONSUMPTION) + Double.valueOf(arg0[0]) * 1000) / 1000));
} else if (water) {
jsonStrGesamt = String.valueOf(Tools.f0.format(new JSONObject(jsonStrGesamt).getJSONObject(Tools.TAG_DATA).getDouble(Tools.TAG_CONSUMPTION) + Double.valueOf(arg0[0])));
}
} catch (JSONException je) {
Log.e("ChannelDetails", je.getMessage());
}
} else {
Log.e("ChannelDetails", "Couldn't get any data from the url");
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
package org.volkszaehler.volkszaehlerapp;

import java.text.DateFormat;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.model.SeriesSelection;
import org.achartengine.model.TimeSeries;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.renderer.XYMultipleSeriesRenderer;
import org.achartengine.renderer.XYSeriesRenderer;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
Expand All @@ -47,6 +26,26 @@
import android.widget.TextView;
import android.widget.Toast;

import org.achartengine.ChartFactory;
import org.achartengine.GraphicalView;
import org.achartengine.model.SeriesSelection;
import org.achartengine.model.TimeSeries;
import org.achartengine.model.XYMultipleSeriesDataset;
import org.achartengine.renderer.XYMultipleSeriesRenderer;
import org.achartengine.renderer.XYSeriesRenderer;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;


public class ChartDetails extends Activity {

Expand All @@ -56,7 +55,7 @@ public class ChartDetails extends Activity {

private final XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();

private final XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
private final XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer(2);

private GraphicalView mChartView;

Expand Down Expand Up @@ -305,10 +304,10 @@ public boolean onTouchEvent(MotionEvent event) {

private void addMultipleGraphs() {

List<CharSequence> channelNames = new ArrayList<CharSequence>();
List<CharSequence> channelNames = new ArrayList<>();

int i = 0;
final HashMap<String, String> channelsToRequest = new HashMap<String, String>();
final HashMap<String, String> channelsToRequest = new HashMap<>();
//get the currently set Channels (in preferences)
for (String uuid : PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getAll().keySet()) {
// assume its a UUID of a channel
Expand Down Expand Up @@ -670,40 +669,35 @@ protected String doInBackground(Void... arg0) {
}
}

if (jsonStr != null) {
if (!jsonStr.startsWith("{\"version\":\"0.3\",\"data")) {
if (jsonStr.startsWith("Error: ")) {
JSONFehler = true;
fehlerAusgabe = jsonStr;
} else {
} else {

// store all data stuff in a shared preference
getApplicationContext().getSharedPreferences("JSONChannelPrefs", Activity.MODE_PRIVATE).edit().putString("JSONChannelsData", jsonStr).commit();

JSONObject jsonObj;
try {
jsonObj = new JSONObject(jsonStr);
werte = jsonObj.getJSONArray(Tools.TAG_DATA);
for (int l = 0; l < werte.length(); l++) {
JSONObject c = werte.getJSONObject(l);
if (c.has(Tools.TAG_TUPLES)) {
JSONArray tuples = c.getJSONArray(Tools.TAG_TUPLES);
// at least one with tuples
JSONFehler = false;
break;
} else {
JSONFehler = true;
fehlerAusgabe = "no tuples data";
}
// store all data stuff in a shared preference
getApplicationContext().getSharedPreferences("JSONChannelPrefs", Activity.MODE_PRIVATE).edit().putString("JSONChannelsData", jsonStr).commit();

JSONObject jsonObj;
try {
jsonObj = new JSONObject(jsonStr);
werte = jsonObj.getJSONArray(Tools.TAG_DATA);
for (int l = 0; l < werte.length(); l++) {
JSONObject c = werte.getJSONObject(l);
if (c.has(Tools.TAG_TUPLES)) {
JSONArray tuples = c.getJSONArray(Tools.TAG_TUPLES);
// at least one with tuples
JSONFehler = false;
break;
} else {
JSONFehler = true;
fehlerAusgabe = "no tuples data";
}

} catch (JSONException e) {
e.printStackTrace();
}

} catch (JSONException e) {
e.printStackTrace();
}
} else {
Log.e("ChartDetails", "Couldn't get any data from the url");
}

return null;
}

Expand All @@ -715,7 +709,6 @@ protected void onPostExecute(String result) {
if (pDialog.isShowing())
pDialog.dismiss();
} catch (Exception e) {
// TODO Auto-generated catch block
// handle Exception
}
if (JSONFehler) {
Expand Down
Loading

0 comments on commit 05dead4

Please sign in to comment.