diff options
Diffstat (limited to 'ccnxandroidmetis/MetisControl')
34 files changed, 0 insertions, 1666 deletions
diff --git a/ccnxandroidmetis/MetisControl/build.gradle b/ccnxandroidmetis/MetisControl/build.gradle deleted file mode 100644 index 99dca119..00000000 --- a/ccnxandroidmetis/MetisControl/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ - -apply plugin: 'com.android.application' - -android { - compileSdkVersion 23 - buildToolsVersion '25.0.0' - - defaultConfig { - applicationId "com.parc.ccnx.ccnxsdk" - minSdkVersion 15 - targetSdkVersion 23 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - applicationVariants.all { variant -> - variant.outputs.each { output -> - project.ext { appName = 'metis' } - def newName = output.outputFile.name - newName = newName.replace("MetisControl", "$project.ext.appName-$System.env.ABI") - output.outputFile = new File(output.outputFile.parent, newName) - } - } - } - } - - dexOptions { - preDexLibraries true - javaMaxHeapSize "2g" // Use gig increments depending on needs - //incremental true - } - - signingConfigs { - release { - storeFile file("metis.keystore") - storePassword "icn_metis" - keyAlias "metis" - keyPassword "icn_metis" - } - } - - buildTypes { - release { - signingConfig signingConfigs.release - } - } -} - - -dependencies { - compile project(':ccnxsupportlibrary') - compile fileTree(include: ['*.jar'], dir: 'libs') - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.android.support:design:23.4.0' - compile 'com.android.support:support-v4:23.4.0' -} diff --git a/ccnxandroidmetis/MetisControl/metis.keystore b/ccnxandroidmetis/MetisControl/metis.keystore Binary files differdeleted file mode 100644 index 3435fccd..00000000 --- a/ccnxandroidmetis/MetisControl/metis.keystore +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/proguard-rules.pro b/ccnxandroidmetis/MetisControl/proguard-rules.pro deleted file mode 100644 index c51dd9b5..00000000 --- a/ccnxandroidmetis/MetisControl/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/walendo/Library/Android/sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml b/ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml deleted file mode 100644 index 272d9270..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/AndroidManifest.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.metis.ccnx.ccnxsdk.metiscontrol"> - - <application - android:allowBackup="true" - android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" - android:supportsRtl="true" - android:theme="@style/AppTheme"> - <activity - android:name=".ForwarderStatusActivity" - android:label="@string/app_name" - android:screenOrientation="portrait" - android:theme="@style/AppTheme.NoActionBar"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - - <service - android:name=".MetisService" - android:enabled="true" - android:exported="true"> - - </service> - - </application> - - - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> - <uses-permission - android:name="android.permission.READ_EXTERNAL_STORAGE" - android:maxSdkVersion="21" /> - <uses-permission android:name="android.permission.INTERNET" /> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> - - -</manifest> - - <!-- android:process=":metis_process" --> diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java deleted file mode 100644 index 7bc6bdb3..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/ForwarderStatusActivity.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.metis.ccnx.ccnxsdk.metiscontrol; - -import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -public class ForwarderStatusActivity extends AppCompatActivity implements - MetisStatusFragment.OnFragmentVisibleListener { - - private static final String TAG = "CCNX FSA"; - - private SectionsPagerAdapter mSectionsPagerAdapter; - - private ViewPager mViewPager; - private Fragment mVisibleFragment; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_forwarder_status); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); - mViewPager = (ViewPager) findViewById(R.id.container); - mViewPager.setAdapter(mSectionsPagerAdapter); - - - final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); - - assert fab != null; - fab.setVisibility(View.GONE); - - fab.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (mVisibleFragment != null) { - if (mVisibleFragment instanceof IMetisAddNewItem) { - IMetisAddNewItem fragment = (IMetisAddNewItem) mVisibleFragment; - fragment.showAddNewItemDialog(); - } - } - } - }); - - } - - - @Override - - public boolean onCreateOptionsMenu(Menu menu) { - getMenuInflater().inflate(R.menu.menu_forwarder_status, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - - int id = item.getItemId(); - - if (id == R.id.action_settings) { - return true; - } - - return super.onOptionsItemSelected(item); - } - - public static class PlaceholderFragment extends Fragment { - - private static final String ARG_SECTION_NUMBER = "section_number"; - - public PlaceholderFragment() { - } - - public static PlaceholderFragment newInstance(int sectionNumber) { - PlaceholderFragment fragment = new PlaceholderFragment(); - Bundle args = new Bundle(); - args.putInt(ARG_SECTION_NUMBER, sectionNumber); - fragment.setArguments(args); - return fragment; - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_forwarder_status, container, false); - TextView textView = (TextView) rootView.findViewById(R.id.section_label); - textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER))); - return rootView; - } - } - - public class SectionsPagerAdapter extends FragmentPagerAdapter { - - public SectionsPagerAdapter(FragmentManager fm) { - super(fm); - } - - @Override - public Fragment getItem(int position) { - return MetisStatusFragment.newInstance(position + 1); - } - - @Override - public int getCount() { - return 1; - } - - @Override - public CharSequence getPageTitle(int position) { - return "SECTION 1"; - } - - - } - - public void onFragmentVisible(Fragment fragment) { - Log.d(TAG, "***** PAGE: " + fragment + " is now showing."); - mVisibleFragment = fragment; - - final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); - - if (fragment instanceof IMetisAddNewItem) { - fab.setVisibility(View.VISIBLE); - } else { - fab.setVisibility(View.INVISIBLE); - } - - String appName = getResources().getString(R.string.app_name); - - if (fragment instanceof IMetisNamedFragment) { - appName += " // " + ((IMetisNamedFragment) fragment).getFragmentName(); - } - - setTitle(appName); - - } - - - -} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java deleted file mode 100644 index 549f4a68..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisAddNewItem.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.metis.ccnx.ccnxsdk.metiscontrol; - -public interface IMetisAddNewItem { - - void showAddNewItemDialog(); - -} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java deleted file mode 100644 index bc4cddca..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/IMetisNamedFragment.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.metis.ccnx.ccnxsdk.metiscontrol; - -public interface IMetisNamedFragment { - public String getFragmentName(); -} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java deleted file mode 100644 index 7b9046ae..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisConstants.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.metis.ccnx.ccnxsdk.metiscontrol; - -public class MetisConstants { - - public static final int MetisDefaultListenerPort = 9695; - - public static final String MetisModule_Control = "Control"; - public static final String MetisModule_FIB = "FIB"; - public static final String MetisModule_PIT = "PIT"; - public static final String MetisModule_ContentStore = "ContentStore"; - public static final String MetisModule_TransportLinkAdapter = "TransportLinkAdapter"; - - public static final String CCNxNameMetis_Forwarder = "ccnx:/local/forwarder"; - public static final String CCNxNameMetis_Control = CCNxNameMetis_Forwarder + "/" + MetisModule_Control; - public static final String CCNxNameMetis_FIB = CCNxNameMetis_Forwarder + "/" + MetisModule_FIB; - public static final String CCNxNameMetis_PIT = CCNxNameMetis_Forwarder + "/" + MetisModule_PIT; - public static final String CCNxNameMetis_ContentStore = CCNxNameMetis_Forwarder + "/" + MetisModule_ContentStore; - ; - public static final String CCNxNameMetis_Link = CCNxNameMetis_Forwarder + "/" + MetisModule_TransportLinkAdapter; - - // General Commands - public static final int MetisCommandSegment = 3; - public static final String MetisCommand_Lookup = "lookup"; - public static final String MetisCommand_Add = "add"; - public static final String MetisCommand_List = "list"; - public static final String MetisCommand_Remove = "remove"; - public static final String MetisCommand_Resize = "resize"; - public static final String MetisCommand_Set = "set"; - public static final String MetisCommand_Quit = "quit"; - public static final String MetisCommand_Run = "spawn"; - public static final String MetisCommand_Stats = "stats"; - - public static final String MetisCommand_LogLevel = "level"; - public static final String MetisCommand_LogDebug = "debug"; - public static final String MetisCommand_LogInfo = "info"; - public static final String MetisCommand_LogError = "error"; - public static final String MetisCommand_LogAll = "all"; - public static final String MetisCommand_LogOff = "off"; - public static final String MetisCommand_LogNotice = "notice"; - ; - - // Module Specific Commands - public static final String CCNxNameMetisCommand_LinkConnect = CCNxNameMetis_Link + "/" + MetisCommand_Add; // create a connection to interface specified in payload, returns name - public static final String CCNxNameMetisCommand_LinkDisconnect = CCNxNameMetis_Link + "/" + MetisCommand_Remove; // remove a connection to interface specified in payload, by name - public static final String CCNxNameMetisCommand_LinkList = CCNxNameMetis_Link + "/" + MetisCommand_List; // list interfaces - - public static final String CCNxNameMetisCommand_FIBLookup = CCNxNameMetis_FIB + "/" + MetisCommand_Lookup; // return current FIB contents for name in payload - public static final String CCNxNameMetisCommand_FIBList = CCNxNameMetis_FIB + "/" + MetisCommand_List; // list current FIB contents - public static final String CCNxNameMetisCommand_FIBAddRoute = CCNxNameMetis_FIB + "/" + MetisCommand_Add; // add route for arguments in payload - public static final String CCNxNameMetisCommand_FIBRemoveRoute = CCNxNameMetis_FIB + "/" + MetisCommand_Remove; // remove route for arguments in payload - - public static final String CCNxNameMetisCommand_PITLookup = CCNxNameMetis_PIT + "/" + MetisCommand_Lookup; // return current PIT contents for name in payload - public static final String CCNxNameMetisCommand_PITList = CCNxNameMetis_PIT + "/" + MetisCommand_List; // list current PIT contents - - public static final String CCNxNameMetisCommand_ContentStoreResize = CCNxNameMetis_ContentStore + "/" + MetisCommand_Resize; // resize current content store to size in MB in payload - - public static final String CCNxNameMetisCommand_Quit = CCNxNameMetis_Control + "/" + MetisCommand_Quit; // ask the forwarder to exit - public static final String CCNxNameMetisCommand_Run = CCNxNameMetis_Control + "/" + MetisCommand_Run; // start a new forwarder instance - public static final String CCNxNameMetisCommand_Set = CCNxNameMetis_Control + "/" + MetisCommand_Set; // set a forwarder variable - public static final String CCNxNameMetisCommand_Stats = CCNxNameMetis_Control + "/" + MetisCommand_Stats; // get forwarder stats -}; diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java deleted file mode 100644 index ee5ef5be..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisService.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.metis.ccnx.ccnxsdk.metiscontrol; - -import android.app.Notification; -import android.app.PendingIntent; -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; -import android.util.Log; - -import com.metis.ccnx.ccnxsupportlibrary.Metis; -import android.widget.TextView; - -import java.io.IOException; -import java.io.OutputStream; -import java.net.Socket; - -public class MetisService extends Service { - private final static String TAG = "CCNx.MetisService"; - - private static Thread sForwarderThread = null; - - public MetisService() { - } - - private String path; - - @Override - public IBinder onBind(Intent intent) { - return null; - } - - - @Override - public int onStartCommand(Intent intent, int flags, int startId) { - - Metis metis = Metis.getInstance(); - if (!metis.isRunning()) { - Log.d(TAG, "Starting Metis"); - String path = null; - if (intent != null && intent.getExtras() != null && intent.getExtras().get("path") != null) { - - path = intent.getExtras().get("path").toString(); - startForwarder(intent, path); - } else { - //TextView mPathTextView = (TextView) view.findViewById(R.id.pathText); - startForwarder(intent, "/storage/emulated/0/MetisConf/metis.cfg".toString()); - } - } else { - Log.d(TAG, "Metis already running."); - } - // Tell Android we want it restarted if it dies or is killed by the OS. - return Service.START_STICKY; - } - - - @Override - public void onDestroy() { - //get Metis instance - Metis metis = Metis.getInstance(); - Log.d(TAG, "Destroying"); - if (metis.isRunning()) { - Log.d(TAG, "Trying to stop Metis: " + metis.toString()); - metis.stop(); - stopForeground(true); - } - super.onDestroy(); - } - - protected Runnable mForwarderRunner = new Runnable() { - - //private String path; - @Override - public void run() { - Metis metis = Metis.getInstance(); - - metis.start(path); - } - - - }; - - - private void startForwarder(Intent intent, String path) { - - int NOTIFICATION_ID = 12345; - - Metis metis = Metis.getInstance(); - if (!metis.isRunning()) { - this.path = path; - sForwarderThread = new Thread(mForwarderRunner, "CCNx.MetisRunner"); - sForwarderThread.start(); - metis.isRunning(); - Intent resultIntent = new Intent(this, ForwarderStatusActivity.class); - - PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, resultIntent, 0); - - Notification notification = new Notification.Builder(getApplicationContext()) - .setContentTitle(getString(R.string.app_name)) - .setContentText("Metis is running") - // .setSmallIcon(R.drawable.ic_notification) - .setSmallIcon(R.mipmap.ic_notification) - .setWhen(System.currentTimeMillis()) - .setContentIntent(pendingIntent) - .build(); - - notification.flags |= Notification.FLAG_NO_CLEAR; - - startForeground(NOTIFICATION_ID, notification); - } - } - - -} diff --git a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java b/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java deleted file mode 100644 index 370a53b4..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/java/com/metis/ccnx/ccnxsdk/metiscontrol/MetisStatusFragment.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.metis.ccnx.ccnxsdk.metiscontrol; - -import android.content.Context; -import android.content.Intent; -import android.os.AsyncTask; -import android.os.Bundle; -import android.os.Handler; -import android.support.design.widget.Snackbar; -import android.support.v4.app.Fragment; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.CompoundButton; -import android.widget.Spinner; -import android.widget.Switch; -import android.widget.TextView; - -import com.metis.ccnx.ccnxsupportlibrary.Metis; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.net.Inet4Address; -import java.net.InetAddress; -import java.nio.charset.Charset; -import java.util.List; - - -public class MetisStatusFragment extends Fragment implements IMetisNamedFragment { - - private static final String ARG_PAGER_INDEX = "metisstatus_pager_number"; - private static final String TAG = "CCNXMetis SF"; - - // TODO: Rename and change types of parameters - private int mPagerIndex; - - private Switch mSwitchMetisOnOff = null; - private Spinner mSpinnerLogLevel = null; - private Switch mSwitchContentStoreOnOff = null; - private TextView mTVNumInterests = null; - private TextView mTVNumContentObjects = null; - private TextView mTVNumInterestReturns = null; - private TextView mTVNumControlMessages = null; - private TextView mTVNumPITEntries = null; - private TextView mPathTextView = null; - - // Stats counters, updated by background task. - private long mNumInterests = 0; - private long mNumCOs = 0; - private long mNumInterestReturns = 0; - private long mNumControl = 0; - private long mNumPITENtries = 0; - - private boolean mIsStatsQueryRunning = false; - - - //private PortalFactory mPortalFactory = null; - - private OnFragmentVisibleListener mListener; - - - /** - * Create a Handler and a Runnable to be called every few seconds to query - * Metis (when running) for stats. - */ - private Handler mStatusUpdaterHandler = new Handler(); - private Runnable mStatusUpdateRunnable = new Runnable() { - @Override - public void run() { - // This runs on the main thread, so start an AsyncTask - // Repeat this the same runnable code block again another few seconds - //new GetStatusTask(null).execute(mPortalFactory); - //if (mIsStatsQueryRunning) { - //mStatusUpdaterHandler.postDelayed(mStatusUpdateRunnable, 2 * 1000); - //} - } - }; - - - public MetisStatusFragment() { - // Required empty public constructor - } - - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @return A new instance of fragment MetisStatusFragment. - */ - // TODO: Rename and change types and number of parameters - public static MetisStatusFragment newInstance(int pagerIndex) { - MetisStatusFragment fragment = new MetisStatusFragment(); - Bundle args = new Bundle(); - args.putInt(ARG_PAGER_INDEX, pagerIndex); - - fragment.setArguments(args); - - return fragment; - } - - @Override - public void onStart() { - Metis metis = Metis.getInstance(); - mSwitchMetisOnOff.setChecked(metis.isRunning()); - super.onStart(); - } - - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - if (getArguments() != null) { - mPagerIndex = getArguments().getInt(ARG_PAGER_INDEX); - } - - - Log.d(TAG, "Creating new PortalFactory"); - //Identity identity = CCNxUtils.createCCNxIdentity(getContext(), - // "password", "ccnxsdkdemo", 1024, 30); - //mPortalFactory = new PortalFactory(identity); - } - - - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - // Inflate the layout for this fragment - View view = inflater.inflate(R.layout.fragment_metis_status, container, false); - - mSwitchMetisOnOff = (Switch) view.findViewById(R.id.switchMetisOnOff); - mSwitchContentStoreOnOff = (Switch) view.findViewById(R.id.switchMetisContentStoreOnOff); - mSpinnerLogLevel = (Spinner) view.findViewById(R.id.spinnerMetisLoggingLevel); - mPathTextView = (TextView) view.findViewById(R.id.pathText) ; - - mSpinnerLogLevel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { - @Override - public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { - String loggingLevel = mSpinnerLogLevel.getSelectedItem().toString(); - updateMetisLoggingLevel(loggingLevel); - } - - @Override - public void onNothingSelected(AdapterView<?> parent) { - - } - }); - - mSwitchMetisOnOff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - if (isChecked) { - startMetis(); - //mSpinnerLogLevel.setEnabled(true); - //Log.d(TAG, "################# Start periodic query for stats"); - //if (!mIsStatsQueryRunning) { - // mStatusUpdaterHandler.postDelayed(mStatusUpdateRunnable, 500); - // mIsStatsQueryRunning = true; - // String loggingLevel = mSpinnerLogLevel.getSelectedItem().toString(); - // if (!loggingLevel.equalsIgnoreCase("off")) { - // updateMetisLoggingLevel(loggingLevel); - // } - //} - } else { - Log.d(TAG, "################# Stop periodic query for stats"); - //mStatusUpdaterHandler.removeCallbacks(mStatusUpdateRunnable); - //mIsStatsQueryRunning = false; - stopMetis(); - //mSpinnerLogLevel.setEnabled(false); - //mSpinnerLogLevel.setSelection(0); - } - } - }); - - mTVNumInterests = (TextView) view.findViewById(R.id.tvStatsNumInterests); - mTVNumContentObjects = (TextView) view.findViewById(R.id.tvStatsNumContentObjects); - mTVNumInterestReturns = (TextView) view.findViewById(R.id.tvStatsNumInterestReturns); - mTVNumControlMessages = (TextView) view.findViewById(R.id.tvStatsNumControl); - mTVNumPITEntries = (TextView) view.findViewById(R.id.tvStatsPITSize); - - mTVNumInterests.setText(String.valueOf(mNumInterests)); - mTVNumContentObjects.setText(String.valueOf(mNumCOs)); - mTVNumControlMessages.setText(String.valueOf(mNumControl)); - mTVNumInterestReturns.setText(String.valueOf(mNumInterestReturns)); - mTVNumPITEntries.setText(""); - - return view; - } - - private void startMetis() { - mPathTextView.setEnabled(false); - Metis metis = Metis.getInstance(); - if (!metis.isRunning()) { - Intent intent = new Intent(getActivity(), MetisService.class); - intent.putExtra("path", mPathTextView.getText()); - getActivity().startService(intent); - - new Handler().postDelayed(new Runnable() { - @Override - public void run() { - createExternalListeners(); - } - }, 1000); - } - } - - private void stopMetis() { - mPathTextView.setEnabled(true); - Intent intent = new Intent(getActivity(), MetisService.class); - - getActivity().stopService(intent); - - } - - private void updateMetisLoggingLevel(String loggingLevel) { - /*Metis metis = Metis.getInstance(); - if (metis.isRunning()) { - // Send an Interest control message to Metis with the new logging level. - String commandURI = MetisConstants.CCNxNameMetisCommand_Set + "/" + MetisConstants.MetisCommand_LogLevel + "/" + loggingLevel; - Name name = new Name(commandURI); - SendInterestTask task = new SendInterestTask(name, null, new SendInterestTask.OnInterestSentListener() { - @Override - public void onInterestSent(Message message) { - if (message instanceof ContentObject) { - - String responseString = new String(((ContentObject) message).payload()); - Snackbar snackbar = Snackbar - .make(mSwitchMetisOnOff, responseString, Snackbar.LENGTH_SHORT); - - snackbar.show(); - } else { - Log.d(TAG, "Unexpected non-Content response from sent Interest"); - } - } - }); - - task.execute(mPortalFactory); - }*/ - } - - private void createExternalListeners() { - - /*Metis metis = Metis.getInstance(); - - if (metis.isRunning()) { - - List<InetAddress> ipAddresses = CCNxUtils.getLocalIpAddress(); - - for (InetAddress addr : ipAddresses) { - - // For the moment, just listen on the IPV4 addresses. The V6 addresses should work, - // but it's not yet tested. - - if (addr instanceof Inet4Address) { - - String ipAddress = addr.getHostAddress(); - - Log.d(TAG, "Adding external listener on: " + ipAddress); - - String linkURI = "tcp://" + ipAddress + ":" + MetisConstants.MetisDefaultListenerPort + "/listener"; - - Name name = new Name(MetisConstants.CCNxNameMetisCommand_LinkConnect); - - SendInterestTask task = new SendInterestTask(name, linkURI.getBytes(), new SendInterestTask.OnInterestSentListener() { - @Override - public void onInterestSent(Message message) { - if (message instanceof ContentObject) { - - String responseString = new String(((ContentObject) message).payload()); - Snackbar snackbar = Snackbar - .make(mSwitchMetisOnOff, responseString, Snackbar.LENGTH_SHORT); - - snackbar.show(); - } else { - Log.d(TAG, "Unexpected non-Content response from sent Interest"); - } - } - }); - - task.execute(mPortalFactory); - } - } - }*/ - } - - - @Override - public void onAttach(Context context) { - super.onAttach(context); - if (context instanceof OnFragmentVisibleListener) { - mListener = (OnFragmentVisibleListener) context; - } else { - throw new RuntimeException(context.toString() - + " must implement OnFragmentInteractionListener"); - } - } - - - @Override - public void setUserVisibleHint(boolean isVisibleToUser) { - super.setUserVisibleHint(isVisibleToUser); - Metis metis = Metis.getInstance(); - - if (isVisibleToUser) { - mListener.onFragmentVisible(this); - - if (metis.isRunning()) { - // Begin updating stats. - if (!mIsStatsQueryRunning) { - mStatusUpdaterHandler.postDelayed(mStatusUpdateRunnable, 100); - mIsStatsQueryRunning = true; - } - } - } else { - mStatusUpdaterHandler.removeCallbacks(mStatusUpdateRunnable); - mIsStatsQueryRunning = false; - } - } - - @Override - public void onDetach() { - mStatusUpdaterHandler.removeCallbacks(mStatusUpdateRunnable); - mIsStatsQueryRunning = false; - super.onDetach(); - mListener = null; - } - - @Override - public String getFragmentName() { - return "Status"; - } - - public interface OnFragmentVisibleListener { - // TODO: Update argument type and name - void onFragmentVisible(Fragment which); - } - - /*private class GetStatusTask extends AsyncTask<PortalFactory, String, Integer> { - - private boolean mSuccess = false; - private PortalFactory mPortalFactory = null; - - - public GetStatusTask(String unused) { - } - - @Override - protected Integer doInBackground(PortalFactory... args) { - Thread.currentThread().setName("GetStatusTask-Async"); - - mPortalFactory = args[0]; - try { - Name controlName = new Name(MetisConstants.CCNxNameMetisCommand_Stats); - - Interest interest = new Interest(controlName); - - try { - Portal portal = mPortalFactory.getPortal(); - - portal.send(interest, 0L); - - Message m = portal.receive(0L); - - if (m instanceof ContentObject) { - mSuccess = true; - ContentObject co = (ContentObject) m; - byte[] payload = co.payload(); - - if (payload != null) { - String jsonString = new String(payload, Charset.defaultCharset()); - //Log.d(TAG, "Received: XX " + jsonString + " XX"); - try { - JSONObject jo = new JSONObject(jsonString); - //Log.d(TAG, "JSON2: " + jo.toString(2)); - - mNumInterests = jo.getLong("numProcessedInterests"); - mNumCOs = jo.getLong("numProcessedContentObjects"); - mNumControl = jo.getLong("numProcessedControlMessages"); - mNumInterestReturns = jo.getLong("numProcessedInterestReturns"); - } catch (JSONException ex) { - Log.e(TAG, "Could not parse returned JSON: " + ex.getMessage()); - } - } - } - portal.close(); - } catch (Portal.CommunicationsError ex) { - Log.e(TAG, "Error sending AddLink command: " + ex.getMessage()); - } - } catch (Exception ex) { - Log.e(TAG, "Error adding link: " + ex.getMessage()); - } - - return 1; - } - - @Override - protected void onPostExecute(Integer ignored) { - - if (mSuccess) { - mTVNumInterests.setText(String.valueOf(mNumInterests)); - mTVNumContentObjects.setText(String.valueOf(mNumCOs)); - mTVNumControlMessages.setText(String.valueOf(mNumControl)); - mTVNumInterestReturns.setText(String.valueOf(mNumInterestReturns)); - mTVNumPITEntries.setText(""); - } - } - }*/ - -} diff --git a/ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml b/ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml deleted file mode 100644 index abb8d9a8..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/drawable/add_panel_border.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <stroke - android:width="3dp" - android:color="@color/colorPrimaryDark" /> - - <corners android:radius="10dip" /> -</shape> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png b/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png Binary files differdeleted file mode 100644 index 660a9e50..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_48.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png b/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png Binary files differdeleted file mode 100644 index f73a233c..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/drawable/ic_plus_96.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml deleted file mode 100644 index 5e627c02..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/activity_forwarder_status.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - android:id="@+id/main_content" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:fitsSystemWindows="true" - tools:context=".ForwarderStatusActivity"> - - <android.support.design.widget.AppBarLayout - android:id="@+id/appbar" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="@dimen/appbar_padding_top" - android:theme="@style/AppTheme.AppBarOverlay"> - - <android.support.v7.widget.Toolbar - android:id="@+id/toolbar" - android:layout_width="match_parent" - android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" - app:layout_scrollFlags="scroll|enterAlways" - app:popupTheme="@style/AppTheme.PopupOverlay"> - - </android.support.v7.widget.Toolbar> - - </android.support.design.widget.AppBarLayout> - - <android.support.v4.view.ViewPager - android:id="@+id/container" - android:layout_width="match_parent" - android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior" /> - - - <android.support.design.widget.FloatingActionButton - android:id="@+id/fab" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="end|bottom" - android:layout_margin="@dimen/fab_margin" - android:src="@android:drawable/ic_input_add" /> - -</android.support.design.widget.CoordinatorLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml deleted file mode 100644 index 943d2ad2..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_forwarder_status.xml +++ /dev/null @@ -1,16 +0,0 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingBottom="@dimen/activity_vertical_margin" - android:paddingLeft="@dimen/activity_horizontal_margin" - android:paddingRight="@dimen/activity_horizontal_margin" - android:paddingTop="@dimen/activity_vertical_margin" - tools:context=".ForwarderStatusActivity$PlaceholderFragment"> - - <TextView - android:id="@+id/section_label" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> - -</RelativeLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml deleted file mode 100644 index 1041eeb4..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_links.xml +++ /dev/null @@ -1,99 +0,0 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:animateLayoutChanges="true" - - tools:context=".MetisLinksFragment"> - - <!-- TODO: Update blank fragment layout --> - - <RelativeLayout - android:id="@+id/rlLinkAddPanel" - android:visibility="visible" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:layout_marginTop="10dp" - android:background="@drawable/add_panel_border" - android:gravity="top" - android:layout_marginBottom="10dp" - android:padding="10px" - - > - - <android.support.v7.widget.AppCompatSpinner - android:id="@+id/spinnerLinkTypeAdd" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="10dp" - android:layout_marginRight="8dp" - android:layout_centerVertical="true" - android:entries="@array/metis_link_type_array" /> - - - <Button - android:id="@+id/btnAddLink" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:text="Add Link" - android:layout_marginRight="10dp" - android:layout_alignParentEnd="true" /> - - <EditText - android:id="@+id/etLinkAddAddress" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:hint="192.168.0.100:9695" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_toRightOf="@id/spinnerLinkTypeAdd" - android:layout_toLeftOf="@id/btnAddLink" /> - - <CheckBox - android:id="@+id/cbLinkListener" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="listener?" - android:layout_toRightOf="@id/spinnerLinkTypeAdd" - android:layout_below="@+id/etLinkAddAddress" /> - - - </RelativeLayout> - - <android.support.v7.widget.LinearLayoutCompat - android:id="@+id/llLinkButtons" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerHorizontal="true" - android:layout_marginBottom="20dp" - android:layout_marginTop="10dp" - android:layout_below="@id/rlLinkAddPanel" - android:orientation="horizontal"> - - <Button - android:id="@+id/btnRefresh" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/rlLinkAddPanel" - android:text="Refresh" /> - - </android.support.v7.widget.LinearLayoutCompat> - - <ListView - android:id="@+id/lvLinkList" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_below="@id/llLinkButtons" - android:layout_gravity="top|center_horizontal" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:layout_marginBottom="80dp" - android:padding="10dp" - android:background="@drawable/add_panel_border" - android:divider="@android:color/transparent" - android:layout_alignParentBottom="true" - android:dividerHeight="10dp" /> - -</RelativeLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_routes.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_routes.xml deleted file mode 100644 index bd0857b5..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_routes.xml +++ /dev/null @@ -1,80 +0,0 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:animateLayoutChanges="true" - - tools:context=".MetisRoutesFragment"> - - <!-- TODO: Update blank fragment layout --> - - <RelativeLayout - android:id="@+id/rlRouteAddPanel" - android:visibility="visible" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:layout_marginTop="10dp" - android:background="@drawable/add_panel_border" - android:gravity="top" - android:layout_marginBottom="10dp" - android:padding="10px" - - > - - <Button - android:id="@+id/btnAddRoute" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:text="Add Route" - android:layout_marginRight="10dp" - android:layout_alignParentEnd="true" /> - - <EditText - android:id="@+id/etRouteAddAddress" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:hint="192.168.0.100:9695" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_toLeftOf="@id/btnAddRoute" /> - - - </RelativeLayout> - - <android.support.v7.widget.LinearLayoutCompat - android:id="@+id/llRouteButtons" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerHorizontal="true" - android:layout_marginBottom="20dp" - android:layout_marginTop="10dp" - android:layout_below="@id/rlRouteAddPanel" - android:orientation="horizontal"> - - <Button - android:id="@+id/btnRefresh" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/rlRouteAddPanel" - android:text="Refresh" /> - - </android.support.v7.widget.LinearLayoutCompat> - - <ListView - android:id="@+id/lvRouteList" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:layout_below="@id/llRouteButtons" - android:layout_gravity="top|center_horizontal" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:layout_marginBottom="80dp" - android:background="@drawable/add_panel_border" - android:padding="10dp" - android:divider="@android:color/transparent" - android:layout_alignParentBottom="true" - android:dividerHeight="10dp" /> - -</RelativeLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_script.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_script.xml deleted file mode 100644 index c248203c..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_script.xml +++ /dev/null @@ -1,54 +0,0 @@ - -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:animateLayoutChanges="true" - tools:context=".MetisStatusFragment"> - - <Button - android:id="@+id/btnRunScript" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal|top" - android:text="Run Script" - android:layout_alignParentTop="true" - android:layout_marginTop="20dp" - android:layout_centerHorizontal="true" /> - - <TextView - android:id="@+id/etScript" - style="@style/Base.TextAppearance.AppCompat.Small" - android:layout_below="@id/btnRunScript" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:enabled="true" - android:isScrollContainer="true" - android:maxLines="100" - android:minLines="6" - android:padding="24dp" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" - android:layout_marginTop="10dp" - android:layout_marginBottom="80dp" - android:focusable="true" - android:inputType="textMultiLine|textNoSuggestions" - android:textIsSelectable="true" - android:layout_centerVertical="true" - android:layout_alignParentStart="true" - android:background="@drawable/add_panel_border" - - /> - - <TextView - android:id="@+id/tvMetisScriptHelp" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/metis_script_help" - android:gravity="center_horizontal" - android:layout_centerInParent="true" - android:paddingBottom="60dp" - android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium" - /> - -</RelativeLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_status.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_status.xml deleted file mode 100644 index 5678f0d4..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/fragment_metis_status.xml +++ /dev/null @@ -1,208 +0,0 @@ - -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".MetisStatusFragment"> - - <!-- TODO: Update blank fragment layout --> - - <RelativeLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - - android:layout_gravity="top|center_horizontal" - android:layout_marginTop="80dp"> - - <EditText - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:inputType="textPersonName" - android:text="/storage/emulated/0/MetisConf/metis.cfg" - android:layout_marginBottom="30dp" - android:layout_gravity="top" - android:ems="10" - android:id="@+id/pathText" - android:typeface="normal" /> - - <Switch - android:id="@+id/switchMetisOnOff" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:layout_below="@id/pathText" - android:layout_marginBottom="30dp" - android:checked="false" - android:text="Metis Enabled " - - android:textAppearance="?android:attr/textAppearanceLarge" /> - - <Switch - android:id="@+id/switchMetisContentStoreOnOff" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/switchMetisOnOff" - android:layout_gravity="center" - android:text="Content Store (cache) " - android:enabled="false" - android:layout_marginBottom="20dp" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/tvLoggingLevelLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:enabled="false" - android:text = "Logging level:" - android:layout_below="@id/switchMetisContentStoreOnOff" - android:textAppearance="?android:attr/textAppearanceMedium" - - /> - - <android.support.v7.widget.AppCompatSpinner - android:id="@+id/spinnerMetisLoggingLevel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/switchMetisContentStoreOnOff" - android:layout_toRightOf="@id/tvLoggingLevelLabel" - android:enabled="true" - android:textAppearance="?android:attr/textAppearanceMedium" - android:entries="@array/metis_log_levels" /> - - - </RelativeLayout> - - <TableLayout - android:visibility="invisible" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="bottom|center_horizontal" - android:background="@drawable/add_panel_border" - android:padding="20dp" - android:layout_marginBottom="80dp" - android:orientation="vertical"> - - <TableRow - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - - android:layout_gravity="center_horizontal" - android:orientation="horizontal"> - - <TextView - android:id="@+id/tvStatsNumInterestsLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="# Interests Processed: " - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/tvStatsNumInterests" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@+id/tvStatsNumInterestsLabel" - android:text="0" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </TableRow> - - <TableRow - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="4dp" - - android:layout_gravity="center_horizontal" - android:orientation="horizontal"> - - <TextView - android:id="@+id/tvStatsNumContentObjectsLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="# ContentObjects Processed: " - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/tvStatsNumContentObjects" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@+id/tvStatsNumInterestsLabel" - android:text="0" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </TableRow> - - <TableRow - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:layout_marginBottom="4dp" - android:orientation="horizontal"> - - <TextView - android:id="@+id/tvStatsNumControlLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="# Control Messages Processed: " - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/tvStatsNumControl" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@+id/tvStatsNumInterestsLabel" - android:text="0" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </TableRow> - - <TableRow - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:layout_marginBottom="4dp" - android:orientation="horizontal"> - - <TextView - android:id="@+id/tvStatsNumInterestReturnsLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="# InterestReturns Processed: " - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/tvStatsNumInterestReturns" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@+id/tvStatsNumInterestsLabel" - android:text="0" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </TableRow> - - <TableRow - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:orientation="horizontal"> - - <TextView - android:id="@+id/tvStatsPITSizeLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="# PIT entries: " - android:textAppearance="?android:attr/textAppearanceMedium" /> - - <TextView - android:id="@+id/tvStatsPITSize" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_toRightOf="@+id/tvStatsNumInterestsLabel" - android:text="0" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </TableRow> - - </TableLayout> - -</FrameLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_links.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_links.xml deleted file mode 100644 index 19bc5548..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_links.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingLeft="10dp" - android:paddingTop="3dp" - > - - <TextView - android:id="@+id/tvLinkName" - android:text="foo bar bar" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" - android:textColor="@color/colorPrimaryDark" - /> - - - <TextView - android:id="@+id/tvLinkLocalOrRemote" - android:text="local" - android:layout_below="@id/tvLinkName" - - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingRight="5dp" - /> - - <TextView - android:id="@+id/tvLinkListener" - android:text="listener" - android:layout_toRightOf="@id/tvLinkLocalOrRemote" - android:layout_below="@id/tvLinkName" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingRight="5dp" - /> - - <TextView - android:id="@+id/tvLinkIPAddress" - android:layout_below="@id/tvLinkName" - android:text="" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingRight="5dp" - android:layout_toRightOf="@id/tvLinkListener" - /> - -</RelativeLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_routes.xml b/ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_routes.xml deleted file mode 100644 index 2372b352..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/layout/listitem_metis_routes.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingLeft="5dp" - android:paddingTop="3dp" - android:background="@color/list_bg_1" - > - - <TextView - android:id="@+id/tvRouteName" - android:text="ccnx:/foo/bar" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" - android:textColor="@color/colorPrimaryDark" - /> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:id="@+id/tvRouteArrow" - android:text="==>" - android:layout_marginLeft="20dp" - android:layout_below="@id/tvRouteName" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" - - /> - - <TextView - android:id="@+id/tvRouteLink" - android:text="dest" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/tvRouteName" - android:layout_marginLeft="15dp" - android:layout_toRightOf="@id/tvRouteArrow" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" - - /> - -</RelativeLayout> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/menu/menu_forwarder_status.xml b/ccnxandroidmetis/MetisControl/src/main/res/menu/menu_forwarder_status.xml deleted file mode 100644 index e94f118a..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/menu/menu_forwarder_status.xml +++ /dev/null @@ -1,10 +0,0 @@ -<menu xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" - tools:context=".metiscontrol.ForwarderStatusActivity"> - <item - android:id="@+id/action_settings" - android:orderInCategory="100" - android:title="@string/action_settings" - app:showAsAction="never" /> -</menu> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-hdpi/ic_launcher.png b/ccnxandroidmetis/MetisControl/src/main/res/mipmap-hdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 96715136..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-hdpi/ic_launcher.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_launcher.png b/ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_launcher.png Binary files differdeleted file mode 100644 index a74e9a0d..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_launcher.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_notification.png b/ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_notification.png Binary files differdeleted file mode 100755 index 82552e85..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-mdpi/ic_notification.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xhdpi/ic_launcher.png b/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xhdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 760fec0f..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xhdpi/ic_launcher.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxhdpi/ic_launcher.png Binary files differdeleted file mode 100644 index d840ecb4..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxhdpi/ic_launcher.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxxhdpi/ic_launcher.png Binary files differdeleted file mode 100644 index 0844619e..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/mipmap-xxxhdpi/ic_launcher.png +++ /dev/null diff --git a/ccnxandroidmetis/MetisControl/src/main/res/values-v21/styles.xml b/ccnxandroidmetis/MetisControl/src/main/res/values-v21/styles.xml deleted file mode 100644 index de6d88e2..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/values-v21/styles.xml +++ /dev/null @@ -1,10 +0,0 @@ - -<resources> - - <style name="AppTheme.NoActionBar"> - <item name="windowActionBar">false</item> - <item name="windowNoTitle">true</item> - <item name="android:windowDrawsSystemBarBackgrounds">true</item> - <item name="android:statusBarColor">@android:color/transparent</item> - </style> -</resources> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/values-w820dp/dimens.xml b/ccnxandroidmetis/MetisControl/src/main/res/values-w820dp/dimens.xml deleted file mode 100644 index 63fc8164..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/values-w820dp/dimens.xml +++ /dev/null @@ -1,6 +0,0 @@ -<resources> - <!-- Example customization of dimensions originally defined in res/values/dimens.xml - (such as screen margins) for screens with more than 820dp of available width. This - would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> - <dimen name="activity_horizontal_margin">64dp</dimen> -</resources> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/values/colors.xml b/ccnxandroidmetis/MetisControl/src/main/res/values/colors.xml deleted file mode 100644 index 2c04684a..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/values/colors.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <color name="colorPrimary">#3F51B5</color> - <color name="colorPrimaryDark">#303F9F</color> - <color name="colorAccent">#FF4081</color> - - <color name="list_bg_1">#ffffff</color> - <color name="list_bg_2">#eafaea</color> - -</resources> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/values/dimens.xml b/ccnxandroidmetis/MetisControl/src/main/res/values/dimens.xml deleted file mode 100644 index cef3abc4..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/values/dimens.xml +++ /dev/null @@ -1,7 +0,0 @@ -<resources> - <!-- Default screen margins, per the Android Design guidelines. --> - <dimen name="activity_horizontal_margin">16dp</dimen> - <dimen name="activity_vertical_margin">16dp</dimen> - <dimen name="fab_margin">16dp</dimen> - <dimen name="appbar_padding_top">8dp</dimen> -</resources> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/values/strings.xml b/ccnxandroidmetis/MetisControl/src/main/res/values/strings.xml deleted file mode 100644 index c38d8f20..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/values/strings.xml +++ /dev/null @@ -1,37 +0,0 @@ -<resources> - <string name="app_name">Metis</string> - <string name="action_settings">Settings</string> - <string name="section_format">Hello World from section: %1$d</string> - - <!-- TODO: Remove or change this placeholder text --> - <string name="asf_hello">Metis Status Fragment</string> - <string name="asf_big_text">METIS STATUS</string> - - <!-- TODO: Remove or change this placeholder text --> - <string name="hello_blank_fragment">Hello blank fragment</string> - - - <string-array name="metis_link_type_array"> - <item>TCP</item> - <item>UDP</item> - </string-array> - - <string-array name="metis_log_levels"> - <item>Off</item> - <item>Notice</item> - <item>Error</item> - <item>Info</item> - <item>Debug</item> - <item>All</item> - </string-array> - - <string name="cancel">Cancel</string> - <string name="add">Add</string> - - <string name="listener_remote">remote</string> - <string name="listener_local">local</string> - <string name="listener_listener">listener</string> - - <string name="metis_script_help">Place an Metis statefile in:\n /mnt/sdcard/ccnx/metis.statefile\nif you want to initialize Metis with\nmany commands.</string> - -</resources> diff --git a/ccnxandroidmetis/MetisControl/src/main/res/values/styles.xml b/ccnxandroidmetis/MetisControl/src/main/res/values/styles.xml deleted file mode 100644 index 545b9c6d..00000000 --- a/ccnxandroidmetis/MetisControl/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ -<resources> - - <!-- Base application theme. --> - <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> - <!-- Customize your theme here. --> - <item name="colorPrimary">@color/colorPrimary</item> - <item name="colorPrimaryDark">@color/colorPrimaryDark</item> - <item name="colorAccent">@color/colorAccent</item> - </style> - - <style name="AppTheme.NoActionBar"> - <item name="windowActionBar">false</item> - <item name="windowNoTitle">true</item> - </style> - - <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> - - <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> - -</resources> |