<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.ocera.orte"
+ package="org.ocera.orte.demo"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
- <uses-permission android:name="android.permission.SET_DEBUG_APP"/>
+
<application
android:allowBackup="true"
- android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
+++ /dev/null
-../../libaorte/libs/armeabi-v7a/ortemanager
\ No newline at end of file
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
-
package org.ocera.orte;
public final class R {
- public static final class attr {
- }
- public static final class drawable {
- public static final int ic_launcher=0x7f020000;
- }
- public static final class id {
- public static final int button1=0x7f070000;
- public static final int button2=0x7f070001;
- public static final int button3=0x7f070002;
- public static final int button4=0x7f070003;
- public static final int menu_settings=0x7f070006;
- public static final int scrollView1=0x7f070004;
- public static final int textView1=0x7f070005;
- }
- public static final class layout {
- public static final int activity_main=0x7f030000;
- }
- public static final class menu {
- public static final int activity_main=0x7f060000;
- }
- public static final class string {
- public static final int app_name=0x7f040000;
- public static final int body1=0x7f040005;
- public static final int button1_tab1=0x7f040002;
- public static final int button1_tab2=0x7f040004;
- public static final int button2_tab1=0x7f040003;
- public static final int button2_tab2=0x7f040006;
- public static final int menu_settings=0x7f040001;
- }
- public static final class style {
- /**
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-
-
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
-
-
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
-
- API 11 theme customizations can go here.
-
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
-
- API 14 theme customizations can go here.
-
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-
-
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
-
-
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
-
- API 11 theme customizations can go here.
-
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
-
- API 14 theme customizations can go here.
- */
- public static final int AppBaseTheme=0x7f050000;
- /** Application theme.
- All customizations that are NOT specific to a particular API-level can go here.
- Application theme.
- All customizations that are NOT specific to a particular API-level can go here.
- */
- public static final int AppTheme=0x7f050001;
- }
+ public static final class drawable {
+ public static final int ic_launcher = 0x7f020000;
+ }
+ public static final class string {
+ public static final int app_name = 0x7f040000;
+ }
+ public static final class style {
+ public static final int AppBaseTheme = 0x7f050000;
+ public static final int AppTheme = 0x7f050001;
+ }
}
/** Automatically generated file. DO NOT MODIFY */
-package org.ocera.orte;
+package org.ocera.orte.demo;
public final class BuildConfig {
public final static boolean DEBUG = true;
--- /dev/null
+/* 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 org.ocera.orte.demo;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class drawable {
+ public static final int ic_launcher=0x7f020000;
+ }
+ public static final class id {
+ public static final int button1=0x7f070000;
+ public static final int button2=0x7f070001;
+ public static final int button3=0x7f070002;
+ public static final int button4=0x7f070003;
+ public static final int menu_settings=0x7f070006;
+ public static final int scrollView1=0x7f070004;
+ public static final int textView1=0x7f070005;
+ }
+ public static final class layout {
+ public static final int activity_main=0x7f030000;
+ }
+ public static final class menu {
+ public static final int activity_main=0x7f060000;
+ }
+ public static final class string {
+ public static final int app_name=0x7f040000;
+ public static final int body1=0x7f040005;
+ public static final int button1_tab1=0x7f040002;
+ public static final int button1_tab2=0x7f040004;
+ public static final int button2_tab1=0x7f040003;
+ public static final int button2_tab2=0x7f040006;
+ public static final int menu_settings=0x7f040001;
+ }
+ public static final class style {
+ /**
+ Base application theme, dependent on API level. This theme is replaced
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+
+
+ Theme customizations available in newer API levels can go in
+ res/values-vXX/styles.xml, while customizations related to
+ backward-compatibility can go here.
+
+
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+
+ API 11 theme customizations can go here.
+
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.
+
+ API 14 theme customizations can go here.
+
+ Base application theme, dependent on API level. This theme is replaced
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+
+
+ Theme customizations available in newer API levels can go in
+ res/values-vXX/styles.xml, while customizations related to
+ backward-compatibility can go here.
+
+
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+
+ API 11 theme customizations can go here.
+
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.
+
+ API 14 theme customizations can go here.
+ */
+ public static final int AppBaseTheme=0x7f050000;
+ /** Application theme.
+ All customizations that are NOT specific to a particular API-level can go here.
+ Application theme.
+ All customizations that are NOT specific to a particular API-level can go here.
+ */
+ public static final int AppTheme=0x7f050001;
+ }
+}
package org.ocera.orte.demo;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
import org.ocera.orte.DomainApp;
import org.ocera.orte.JOrte;
+import org.ocera.orte.Manager;
import org.ocera.orte.Publication;
-import org.ocera.orte.R;
import org.ocera.orte.types.DomainProp;
import org.ocera.orte.types.NtpTime;
import org.ocera.orte.types.ORTEConstant;
Button start_pub = null;
Button stop_pub = null;
TextView textview = null;
- Process manager = null;
+ Manager manager = null;
Thread publisher = null;
boolean tContinue = true;
}
}
- public void copyManager() {
- BufferedInputStream bis = null;
- BufferedOutputStream bos = null;
-
- String path = getFilesDir().getAbsolutePath() + "/ortemanager";
-
- if (!new File(path).exists()) {
- try {
- bis = new BufferedInputStream(getAssets().open("ortemanager"));
- bos = new BufferedOutputStream(new FileOutputStream(path));
-
- int delka;
- byte[] buffer = new byte[4096];
-
- while((delka = bis.read(buffer, 0, 4096)) > 0) {
- bos.write(buffer, 0, delka);
- }
-
- bos.flush();
- bos.close();
- bis.close();
-
- Runtime.getRuntime().exec("chmod 744 " + path);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
@Override
protected void onResume() {
super.onResume();
mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass().getName());
mGravity = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
-
- copyManager();
start.setOnClickListener(new View.OnClickListener() {
- String[] orte = {getFilesDir().getAbsolutePath() + "/ortemanager","-p 192.168.1.5:192.168.1.8"};
+ String[] mgrs = {"192.168.1.5","192.168.1.8"};
@Override
public void onClick(View v) {
start.setEnabled(false);
stop.setEnabled(true);
- try {
- manager = Runtime.getRuntime().exec(orte);
- } catch (IOException e) {
- e.printStackTrace();
- }
+ manager = new Manager(mgrs);
+
start_pub.setEnabled(true);
}
});
stop.setEnabled(false);
start_pub.setEnabled(false);
stop_pub.setEnabled(false);
- manager.destroy();
+ manager = null;
+ System.gc();
}
});