Skip to content

Commit

Permalink
edit file header
Browse files Browse the repository at this point in the history
  • Loading branch information
bertrandmartel committed Feb 16, 2016
1 parent d5efbb1 commit 9e7862f
Show file tree
Hide file tree
Showing 18 changed files with 462 additions and 38 deletions.
4 changes: 0 additions & 4 deletions iotf-sample/iotf-sample.iml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/8.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
Expand All @@ -88,8 +86,6 @@
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="play-services-basement-8.1.0" level="project" />
<orderEntry type="library" exported="" name="play-services-appindexing-8.1.0" level="project" />
<orderEntry type="library" exported="" name="org.eclipse.paho.client.mqttv3-1.0.3-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="org.eclipse.paho.android.service-1.0.3-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.2.1" level="project" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.android.iotf.app;

import android.app.NotificationManager;
Expand All @@ -15,7 +38,6 @@
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.inputmethod.InputMethodManager;
Expand All @@ -32,7 +54,9 @@
import fr.bmartel.android.iotf.app.inter.IBaseActivity;

/**
* Created by akinaru on 15/02/16.
* Common abstract activity
*
* @author Bertrand Martel
*/
public abstract class BaseActivity extends AppCompatActivity implements IBaseActivity {

Expand All @@ -46,10 +70,6 @@ public abstract class BaseActivity extends AppCompatActivity implements IBaseAct

private NotificationManager notifyMgr = null;

private int mNotificationCount = 0;

private int mNotificationId = 1337;

private Ringtone ringtone;

private PowerManager.WakeLock screenLock;
Expand Down Expand Up @@ -113,7 +133,11 @@ protected ActionBarDrawerToggle setupDrawerToggle() {
return new ActionBarDrawerToggle(this, mDrawer, toolbar, R.string.drawer_open, R.string.drawer_close);
}


/**
* Build listener for navigation view
*
* @param navigationView
*/
protected void setupDrawerContent(NavigationView navigationView) {

navigationView.setNavigationItemSelectedListener(
Expand Down Expand Up @@ -149,12 +173,17 @@ protected void hideSoftKeyboard() {
}
}

/**
* process menu item selected
*
* @param menuItem
* @param mDrawer
* @param context
*/
protected void selectDrawerItem(MenuItem menuItem, DrawerLayout mDrawer, Context context) {

Log.i("test", "selectDrawerItem");
switch (menuItem.getItemId()) {
case R.id.report_bugs: {
Log.i("test", "report_bugs");
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "[email protected]", null));
intent.putExtra(Intent.EXTRA_SUBJECT, "iotf Issue");
Expand All @@ -177,6 +206,11 @@ protected void selectDrawerItem(MenuItem menuItem, DrawerLayout mDrawer, Context
mDrawer.closeDrawers();
}

/**
* create a notification with defined message
*
* @param message notification message
*/
protected void triggerNotification(String message) {

Intent intent = new Intent(this, ConnectActivity.class);
Expand All @@ -199,6 +233,12 @@ protected void triggerNotification(String message) {
notifyMgr.notify(0, n.build());
}

/**
* Convert notification list to Json string
*
* @param filterList
* @return
*/
protected String convertNotificationFilterListToJsonArrayStr(List<NotificationFilter> filterList) {
JSONArray array = new JSONArray();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
package fr.bmartel.android.iotf.app;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
Expand All @@ -48,6 +47,8 @@
import fr.bmartel.android.iotf.listener.IMessageCallback;

/**
* Connection activity : configure connection
*
* @author Bertrand Martel
*/
public class ConnectActivity extends BaseActivity {
Expand Down Expand Up @@ -140,6 +141,12 @@ protected void onCreate(Bundle savedInstance) {
initNv();
}

/**
* Load URI file
*
* @param intent
* @return
*/
private String loadFile(Intent intent) {
try {
BufferedReader buffer = new BufferedReader(new InputStreamReader(getContentResolver().openInputStream(intent.getData())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,26 @@
import fr.bmartel.android.iotf.listener.IMessageCallback;

/**
* Notification activity
*
* @author Bertrand Martel
*/
public class NotificationActivity extends BaseActivity implements INotificationFilter, IPhoneNotificationListener {

private static final String TAG = NotificationActivity.class.getSimpleName();

private ListView notificationListview;

private NotificationArrayAdapter notificationAdapter;

/**
* list if all received notifications
*/
private ArrayList<IncomingMessage> notificationItems = new ArrayList<>();

/**
* list of notification filter values
*/
private List<NotificationFilter> messageBodyFilterList = new ArrayList<>();

private boolean init = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,43 @@
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.android.iotf.app;

/**
* Created by akinaru on 16/02/16.
* Notification object
*
* @author Bertrand Martel
*/
public class NotificationFilter {

/**
* notification filter value
*/
private String mFilter = "";

/**
* notification message
*/
private String mNotificationMessage = "";

public NotificationFilter(String filter, String notificationMessage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import fr.bmartel.android.iotf.app.model.IncomingMessage;

/**
* Adapter for Phone notification creation Dialog
*
* @author Bertrand Martel
*/
public class NotificationArrayAdapter extends BaseAdapter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.android.iotf.app.adapter;

import android.content.Context;
Expand All @@ -10,7 +33,9 @@
import fr.bmartel.android.iotf.app.R;

/**
* Created by akinaru on 09/02/16.
* Adapter for Open Source projects Dialog
*
* @author Bertrand Martel
*/
public class OpenSourceItemAdapter extends BaseAdapter {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.android.iotf.app.adapter;

import android.content.Context;
Expand All @@ -14,7 +37,9 @@
import fr.bmartel.android.iotf.app.R;

/**
* Created by akinaru on 16/02/16.
* Adapter for Phone notification listview Dialog
*
* @author Bertrand Martel
*/
public class PhoneNotificationAdapter extends BaseAdapter {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.android.iotf.app.constant;

/**
* Created by akinaru on 15/02/16.
* Constants for persistence
*
* @author Bertrand Martel
*/
public class StorageConst {
public class StorageConst{

public final static String STORAGE_PROFILE = "STORAGE";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import fr.bmartel.android.iotf.app.R;

/**
* Created by akinaru on 09/02/16.
* About Dialog
*
* @author Bertrand Martel
*/
public class AboutDialog extends AlertDialog {

Expand Down
Loading

0 comments on commit 9e7862f

Please sign in to comment.