Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
<classpathentry kind="lib" path="libs/Parse-1.5.1.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
41 changes: 27 additions & 14 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
android:versionName="1.0" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>

<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="19" />
Expand All @@ -38,13 +39,25 @@
android:label="@string/title_activity_sign_up"
android:parentActivityName="com.codepath.beacon.ui.LoginActivity" >
</activity>
<service android:name="com.codepath.beacon.scan.BleService">
</service>

<activity android:name="com.codepath.beacon.scan.BleActivity">
</activity>


<activity
android:name="com.codepath.beacon.activity.MyRecipeActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.codepath.beacon.activity.RecipeDetailActivity"
android:label="@string/title_activity_recipe_detail" >
</activity>

<service android:name="com.codepath.beacon.scan.BleService" >
</service>

<activity android:name="com.codepath.beacon.scan.BleActivity" >
</activity>
</application>

</manifest>
</manifest>
1 change: 1 addition & 0 deletions libs/Parse-1.5.1.jar.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc=Parse-1.5.1-javadoc
Binary file added res/drawable-hdpi/ic_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_beacon_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-hdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_beacon_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_beacon_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_beacon_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions res/layout/activity_my_recipe.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<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"
tools:context="${packageName}.${activityClass}" >

<FrameLayout
android:id="@+id/flrecipelist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" >

</FrameLayout>

</RelativeLayout>
130 changes: 130 additions & 0 deletions res/layout/activity_recipe_detail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvIF"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="27dp"
android:layout_marginTop="63dp"
android:text="@string/if_label"
android:textAppearance="?android:attr/textAppearanceMedium" />

<ImageButton
android:id="@+id/btn_beacon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/textView1"
android:layout_marginLeft="16dp"
android:layout_toRightOf="@+id/textView1"
android:maxHeight="50dp"
android:maxWidth="50dp"
android:src="@drawable/ic_beacon_btn" />

<ImageButton
android:id="@+id/btn_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/TextView01"
android:layout_marginLeft="24dp"
android:layout_toRightOf="@+id/TextView01"
android:src="@drawable/ic_notification" />

<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/btn_beacon"
android:layout_centerHorizontal="true"
android:text="@string/then_label"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/btn_beacon"
android:layout_marginTop="55dp"
android:text="@string/tvActivateOn" />

<TextView
android:id="@+id/tvActivationDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView2"
android:layout_alignLeft="@+id/TextView01"
android:text="@string/tvDate" />

<TextView
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_below="@+id/textView2"
android:layout_marginTop="17dp"
android:text="@string/tvTriggered" />

<TextView
android:id="@+id/tvTriggeredCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/TextView02"
android:layout_alignBottom="@+id/TextView02"
android:layout_alignLeft="@+id/tvActivationDate"
android:text="@string/tvTiggerCount" />

<TextView
android:id="@+id/TextView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/TextView02"
android:layout_below="@+id/TextView02"
android:layout_marginTop="22dp"
android:text="@string/tvDistance" />

<TextView
android:id="@+id/tvBeaconDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/TextView04"
android:layout_alignBottom="@+id/TextView04"
android:layout_alignLeft="@+id/tvTriggeredCount"
android:text="@string/tvBeaconDistance" />

<TextView
android:id="@+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/TextView04"
android:layout_below="@+id/TextView04"
android:layout_marginTop="22dp"
android:text="@string/receive_label" />

<ToggleButton
android:id="@+id/tbStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/btn_notification"
android:layout_below="@+id/TextView03"
android:layout_marginTop="18dp"
android:textOn="Yes"
android:textOff="No"
android:text="ToggleButton" />

<TextView
android:id="@+id/tvBeaconnameandUUID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/tvActivationDate"
android:layout_alignLeft="@+id/textView2"
android:layout_marginBottom="18dp"
android:text="@string/beaconname_label" />

</RelativeLayout>
14 changes: 14 additions & 0 deletions res/layout/fragment_empty_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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" >

<ImageView
android:id="@+id/ivEmpty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_empty" />

</RelativeLayout>
12 changes: 12 additions & 0 deletions res/layout/fragment_recipe_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<ListView
android:id="@+id/lvRecipes"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
/>
</LinearLayout>
56 changes: 56 additions & 0 deletions res/layout/recipe_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingTop="5dp" >

<TextView
android:id="@+id/tvbeaconname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:text="@string/beacon_label"
android:textSize="13sp"
android:textStyle="bold" />

<TextView
android:id="@+id/tvtrigger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/tvbeaconname"
android:layout_below="@+id/tvbeaconname"
android:autoLink="all"
android:linksClickable="true"
android:text="@string/trigger_label"
android:textColorHighlight="#7C82D2"
android:textColorHint="#2DC942"
android:textColorLink="#483D8B"
android:textSize="13sp" />

<ToggleButton
android:id="@+id/tbtrigger"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvnotification"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/tvbeaconname"
android:text="@string/tb_label"
android:textOff="No"
android:textOn="Yes" />

<TextView
android:id="@+id/tvnotification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/tvtrigger"
android:layout_alignBottom="@+id/tvtrigger"
android:layout_marginLeft="25dp"
android:layout_toRightOf="@+id/tvtrigger"
android:text="@string/action_label"
android:textSize="13sp" />

</RelativeLayout>
11 changes: 11 additions & 0 deletions res/menu/my_recipe.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/miAdd"
android:icon="@drawable/ic_add"
android:showAsAction="ifRoom"
android:onClick="onAddAction"
android:title="Add">
</item>

</menu>
17 changes: 15 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,23 @@
<string name="new_user_hint">New User?</string>
<string name="sign_up_link_hint">"Sign up here"</string>
<string name="title_activity_sign_up">SignUpActivity</string>

<string name="action_refresh">Refresh</string>
<string name="scanning">Looking for devices. Please wait..</string>
<string name="no_devices">No devices found</string>

<string name="beacon_label">BeaconFriendlyName</string>
<string name="trigger_label">Approaching</string>
<string name="action_label">send notification</string>
<string name="tb_label">On</string>
<string name="title_activity_recipe_detail">RecipeDetailActivity</string>
<string name="if_label">IF</string>
<string name="then_label">Then</string>
<string name="tvActivateOn">"Activated on:"</string>
<string name="tvDate">Date</string>
<string name="tvTriggered">Triggered:</string>
<string name="tvTiggerCount">Count</string>
<string name="tvDistance">Distance:</string>
<string name="tvBeaconDistance">Beacon Distance</string>
<string name="receive_label">Receive Notification with this beacon</string>
<string name="beaconname_label">Beacon Name and UUID</string>

</resources>
11 changes: 5 additions & 6 deletions src/com/codepath/beacon/BeaconApplication.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.codepath.beacon;

import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.ParseUser;
import com.parse.SaveCallback;

import android.app.Application;
import android.util.Log;

import com.codepath.beacon.models.Recipe;
import com.parse.Parse;
import com.parse.ParseObject;

public class BeaconApplication extends Application {
private static final String LOG_TAG = BeaconApplication.class.getSimpleName();
private static final String APP_ID = "KopNnh31P28DZMDp9njtWRDpgUkn2qwrMBNZ53VJ";
Expand All @@ -19,6 +17,7 @@ public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
Log.d(LOG_TAG, "onCreate(). Initializing Parse");
ParseObject.registerSubclass(Recipe.class);
Parse.initialize(this, APP_ID, CLIENT_KEY);
}
}
Loading