Transcript
Page 1: Open Android Apps - Hidden Treasures on Android phones

www.openintents.org [email protected] Droidcon 2011 Berlin,24 March 2011

Hidden Treasure: Open Android Apps

Friedger Müffke

@fmdroid#openintents

Page 2: Open Android Apps - Hidden Treasures on Android phones

No monoliths ..

but interconnectedcomponents

All apps are equal!

Page 3: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Intents

● Add „journey schedule“ to shopping list app

5 lines of code

● Add „book a table“ to calendar app

50 lines of code

● Add „AR browser“ to post office app

1 library + 25 lines of code

Page 4: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Intents

e.g. in Activity

Intent i = new Intent(„com.opentable.action.RESERVE“);i.setData(„reserve://opentable.com/45112?partySize=3“);

this.startActivity(i);this.startActivityForResult(i, RESCODE);this.startService(i);this.bindService(i, con, 0);this.sendBroadcast(i);

Page 5: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Manifest<?xml version="1.0" encoding="utf-8"?> <manifest . . . > <application . . . > <activity

android:name="org.openintents.shopping.ShoppingActivity" android:icon="@drawable/small_pic.png" android:label="@string/shopping" . . . >

<intent-filter> <action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.INSERT" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType = "vnd.android.cursor.dir/vnd.openintents.shopping.item" /> </intent-filter> </activity>

<service . . ./> . . . <uses-permisson . . . /> <uses-library . . . /></application> </manifest>

Page 6: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Sending Result

● Called app:

getCallingActivity()

Intent reply = new Intent();reply.putExtra(„SCAN_RESULT“, value);reply.putExtra(„QUALITY“, quality);setResult(RESULT_OK, reply);finish();

● Calling app:

onActivityResult()

Page 7: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Open Apps

● Declare intent filters in your Manifest

with CATEGORY_DEFAULT● Publish your intent filters on your website and

open-android-apps.appspot.com

● Explore intents and which apps do offer the corresponding functionality

Page 8: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Study

● Analysize of apps in application store Appoke● ~1500 apps (paid + free)● 350 apps declare intent filter

other than launcher● Many wired and wrong intent filter● 1% of apps declare useful intent filter

Looking for more apps stores to participate!

Page 9: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Common use cases

● SEND, SEND_TO, SENDMULTIPLE

– Images, texts

– Blogs, SMS, ..

● VIEW– Images, text

– Websites (http scheme)

● Filemanager (start „best“ app for file)

● Theming and configuration

● SHOW_RADAR● RESERVE● CALIBRATE● AUTHENTICATE● HELP

Page 10: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Open Apps (2)

In the future

– Mark as inappropriate– Integration in dependency manager– Link to Intents Registry– Eclipse Integration

Google Summer Of Code 2011 – for students

Page 11: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

Participate!

● Visit the Android Open Source Project (AOP)● OpenIntents repository at Google code● Android is open as are these issues

– Issue 4716: Support package dependency through uses-intent in Manifest

– Issue 3217: Support PackageManager.GET_INTENT_FILTERS

● Google Group appfeed

Page 12: Open Android Apps - Hidden Treasures on Android phones

@fmdroid – Open Android Apps Droidcon 2011 Berlin, 24 March 2011

More infoWeb site:

www.openintents.orgDeveloper group: http://groups.google.com/group/openintents

Code repository: http://openintents.googlecode.com


Top Related