Skip to content

Commit

Permalink
Aware
Browse files Browse the repository at this point in the history
Android application to locate places of interest the user - by location
. using google places API.
  • Loading branch information
dt170 committed Feb 29, 2016
0 parents commit 28a34e3
Show file tree
Hide file tree
Showing 230 changed files with 5,332 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
32 changes: 32 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.dt.project"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.squareup.picasso:picasso:2.3.2'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\Programs\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 *;
#}
13 changes: 13 additions & 0 deletions app/src/androidTest/java/com/dt/project/ApplicationTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.dt.project;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
46 changes: 46 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dt.project">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyBQCOCS4hEaBH7cM2_q8IWb4mOs1g4JzNc" />

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver android:name=".Receiver.PhoneReceiver">
<intent-filter>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
</intent-filter>
</receiver>

<activity
android:name=".Phone.InfoPlaceActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name=".Phone.MapAndInfoPhoneActivity"
android:label="@string/title_activity_map_and_info"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".Tablet.TabletPlaceInfo"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.dt.project.AsyncTasks;

import android.os.AsyncTask;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;


//Start an asynctask the bring all the information on the user options when he types
public class AutoCompleteAsyncTask extends AsyncTask<URL, Void, String> {

private Callbacks callbacks;
private String errorMessage = null;

public AutoCompleteAsyncTask(Callbacks callbacks) {
this.callbacks = callbacks;
}

protected String doInBackground(URL... params) {

try {

URL url = params[0];

HttpURLConnection connection = (HttpURLConnection) url.openConnection();

int httpStatusCode = connection.getResponseCode();

if (httpStatusCode == HttpURLConnection.HTTP_BAD_REQUEST) {
errorMessage = "No Such Symbol";
return null;
}
if (httpStatusCode != HttpURLConnection.HTTP_OK) {
errorMessage = connection.getResponseMessage();
return null;
}

InputStream inputStream = connection.getInputStream();
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);

String result = "";

String oneLine = bufferedReader.readLine();

while (oneLine != null) {
result += oneLine + "\n";
oneLine = bufferedReader.readLine();
}
bufferedReader.close();
inputStreamReader.close();
inputStream.close();

return result;

} catch (Exception ex) {
errorMessage = ex.getMessage();
return null;
}
}

protected void onPostExecute(String result) {

if (errorMessage != null) {
callbacks.onError(errorMessage);
} else {
try {
callbacks.onSuccessWords(result);
} catch (Exception e) {
e.printStackTrace();
}
}
}

public interface Callbacks {

void onSuccessWords(String result);

void onError(String errorMessage);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.dt.project.AsyncTasks;


import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.util.Log;
import java.io.InputStream;

//Taking url String and preform AsyncTask in order to show the image
public class DownloadImageAsyncTask extends AsyncTask<String, Void, Bitmap> {

private Callbacks callbacks;

public DownloadImageAsyncTask(Callbacks callbacks) {
this.callbacks = callbacks;
}

protected Bitmap doInBackground(String... urls) {
String url = urls[0];
Bitmap mIcon11 = null;
try {
InputStream in = new java.net.URL(url).openStream();
mIcon11 = BitmapFactory.decodeStream(in);
} catch (Exception ex) {
Log.e("Error", ex.getMessage());
ex.printStackTrace();
}

return mIcon11;
}

protected void onPostExecute(Bitmap result) {
callbacks.onSuccess(result);
}
public interface Callbacks{
void onSuccess(Bitmap result);
}
}
Loading

0 comments on commit 28a34e3

Please sign in to comment.