Skip to content

Commit 0b523db

Browse files
author
David J. Kordsmeier
committed
Refs #100816 Add a CCND Status menu option. Rather than integrate a web
view, let's send the intent to the browser.
1 parent c52f4c1 commit 0b523db

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

android/CCNx-Android-Services/res/menu/servicemenu.xml

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
android:title="@string/label_reset" />
55
<item android:id="@+id/about"
66
android:title="@string/label_about" />
7+
<item android:id="@+id/ccndstatus"
8+
android:title="@string/label_ccndstatus" />
79
</menu>

android/CCNx-Android-Services/res/values/strings.xml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<string name="label_ccns_debug">CCNS_DEBUG:</string>
2828
<string name="label_about">About</string>
2929
<string name="label_reset">Reset Service</string>
30+
<string name="label_ccndstatus">CCND Status</string>
3031
<string name="label_ok">OK</string>
3132
<string name="service_started1_msg">CCNx Service Control started</string>
3233
<string name="about_text">CCNx 0.6.2\n/*

android/CCNx-Android-Services/src/org/ccnx/android/services/Controller.java

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import android.widget.EditText;
4848
import android.widget.Toast;
4949
import android.widget.Spinner;
50+
import android.net.Uri;
5051

5152
import java.net.InetAddress;
5253
import java.net.NetworkInterface;
@@ -58,6 +59,7 @@
5859
*/
5960
public final class Controller extends Activity implements OnClickListener {
6061
public final static String TAG = "CCNx Service Controller";
62+
public static final String CCNX_WS_URL = "http://127.0.0.1:9695";
6163
private Button mAllBtn;
6264
private ProgressDialog pd;
6365

@@ -167,6 +169,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
167169
Toast.makeText(this, "Reset CCNxServiceStatus complete, new status is: {ccnd: " + control.getCcndStatus().name() +
168170
", repo: " + control.getRepoStatus().name() + "}", 10).show();
169171
return true;
172+
case R.id.ccndstatus:
173+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(CCNX_WS_URL));
174+
startActivity(intent);
175+
return true;
170176
case R.id.about:
171177
setContentView(R.layout.aboutview);
172178
TextView aboutdata = (TextView) findViewById(R.id.about_text);

0 commit comments

Comments
 (0)