├── .gitignore ├── AndroidManifest.xml ├── README.md ├── ic_launcher-web.png ├── proguard.cfg ├── project.properties ├── res ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── drawable-xxhdpi │ └── ic_launcher.png └── values │ └── strings.xml └── src └── com └── idunnolol └── quickmap └── QuickMapActivity.java /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | gen/ 3 | .settings/ 4 | .project 5 | .classpath 6 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | QuickMap is a small utility program I wrote for a friend, who complained that there were too many clicks between the contact list and getting directions to that person's house. This app will open up the contacts app with a chooser for directions, which will then direct the user to the Google Maps app. 2 | 3 | This code is totally open for use by anyone, mostly because it's incredibly simple. -------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlew/android-quickmap/85e6e0f2aa8c0587e300408c0629608344d25cfa/ic_launcher-web.png -------------------------------------------------------------------------------- /proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-7 12 | -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlew/android-quickmap/85e6e0f2aa8c0587e300408c0629608344d25cfa/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlew/android-quickmap/85e6e0f2aa8c0587e300408c0629608344d25cfa/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlew/android-quickmap/85e6e0f2aa8c0587e300408c0629608344d25cfa/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlew/android-quickmap/85e6e0f2aa8c0587e300408c0629608344d25cfa/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Quick Map 5 | 6 | -------------------------------------------------------------------------------- /src/com/idunnolol/quickmap/QuickMapActivity.java: -------------------------------------------------------------------------------- 1 | package com.idunnolol.quickmap; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.database.Cursor; 6 | import android.net.Uri; 7 | import android.os.Bundle; 8 | import android.provider.ContactsContract.CommonDataKinds.StructuredPostal; 9 | 10 | public class QuickMapActivity extends Activity { 11 | 12 | private static final int PICK_ADDRESS = 1; 13 | 14 | @Override 15 | public void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | 18 | Intent intent = new Intent(Intent.ACTION_PICK); 19 | intent.setType(StructuredPostal.CONTENT_TYPE); 20 | startActivityForResult(intent, PICK_ADDRESS); 21 | } 22 | 23 | @Override 24 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 25 | if (requestCode == PICK_ADDRESS) { 26 | if (resultCode == RESULT_OK && data.getData() != null) { 27 | Cursor c = managedQuery(data.getData(), null, null, null, null); 28 | if (c != null) { 29 | c.moveToFirst(); 30 | String address = c.getString(c.getColumnIndexOrThrow(StructuredPostal.FORMATTED_ADDRESS)); 31 | 32 | Intent intent = new Intent(Intent.ACTION_VIEW); 33 | intent.setData(Uri.parse("geo:0,0?q=" + address)); 34 | startActivity(intent); 35 | } 36 | } 37 | 38 | finish(); 39 | } 40 | } 41 | } --------------------------------------------------------------------------------