Added version number to about page.
This commit is contained in:
parent
d9052dfff3
commit
7264554de3
2 changed files with 44 additions and 2 deletions
|
|
@ -2,7 +2,9 @@
|
||||||
<body>
|
<body>
|
||||||
<h1>About</h1>
|
<h1>About</h1>
|
||||||
<hr />
|
<hr />
|
||||||
This application was developed by Ziver Koc (Ericsson AB).
|
Version {VERSION}, BuildNumber {BUILD}
|
||||||
|
<br /><br />
|
||||||
|
Application was developed by Ziver Koc (at Ericsson AB).
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<h3>Attributions:</h3>
|
<h3>Attributions:</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,59 @@
|
||||||
package com.ericsson.uecontrol.gui;
|
package com.ericsson.uecontrol.gui;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.res.AssetManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
|
||||||
|
import com.ericsson.uecontrol.BuildConfig;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ezivkoc on 2014-07-28.
|
* Created by ezivkoc on 2014-07-28.
|
||||||
*/
|
*/
|
||||||
public class AboutActivity extends Activity{
|
public class AboutActivity extends Activity{
|
||||||
|
private static final Logger log = Logger.getLogger(AboutActivity.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
String html = "";
|
||||||
|
try {
|
||||||
|
html = getAssetContent("www/about.html");
|
||||||
|
|
||||||
|
// Replace keywords
|
||||||
|
html = html.replace("{VERSION}", BuildConfig.VERSION_NAME);
|
||||||
|
html = html.replace("{BUILD}", "" + BuildConfig.VERSION_CODE);
|
||||||
|
} catch(IOException e){
|
||||||
|
html = e.getMessage();
|
||||||
|
log.error(null, e);
|
||||||
|
}
|
||||||
|
|
||||||
WebView view = new WebView(this);
|
WebView view = new WebView(this);
|
||||||
view.loadUrl("file:///android_asset/www/about.html");
|
//view.loadUrl("file:///android_asset/www/about.html");
|
||||||
|
view.loadData(html, "text/html", "UTF-8");
|
||||||
this.setContentView(view);
|
this.setContentView(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getAssetContent(String file) throws IOException {
|
||||||
|
StringBuilder ret = new StringBuilder();
|
||||||
|
AssetManager assetManager = getResources().getAssets();
|
||||||
|
BufferedReader reader = new BufferedReader(
|
||||||
|
new InputStreamReader(
|
||||||
|
assetManager.open(file)));
|
||||||
|
String line = null;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
ret.append(line).append("\n");
|
||||||
|
}
|
||||||
|
reader.close();
|
||||||
|
return ret.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue