Google I/O 2013 App Source Now Available

TL;DR: code.google.com/p/iosched has been updated for #io13

Every year, a few days before the Google I/O developer conference, the Android team publishes an app on Google Play that has two main goals. The first goal is to help conference-goers and remote viewers navigate their way around Moscone West or watch the keynote and session videos on their Android devices from home.

The second, and arguably more important goal of the app, is to serve as a large-scale demo of Android best practices covering both app design and technical implementation. Like any demo though, it's only useful if you can see how it all works by looking at the source code.

So today we're happy to announce that the Google I/O 2013 app source code is now available! Check it out by clicking the link below:

Google I/O 2013 Android App Source: http://code.google.com/p/iosched

The app source demonstrates a number of best practices such as:

• Implementing responsive design with fragments and alternative resources to support phones and tablets
• Using content providers and implicit intents to navigate the app
• Using sync adapters and GCM to keep content fresh across devices in a battery-friendly way
• Integrating Google+ for sign-in, public stream participation, and as a share target
• Integrating Google Play services to include Google Maps (with custom tiles, markers, and info windows) and +1 buttons
• Integrating the YouTube Android Player API to view live streams and recorded session videos, along with 'second-screen' presentation API support
• Exposing multiple entry points to the app with home screen and lockscreen widgets and expandable notifications

This is just a sample of the best practices covered in the app. There are tons of little gems to explore in the source code, available at the project site linked above.

Have any questions or comments on a particular part of the source? Post them in the comments below!

#AndroidDev   #io13
609
405
Aminuddin Mukhdi's profile photoNacho Coloma's profile photoBeto Montejo's profile photoroger alien's profile photo
74 comments
 
Let us know right here in the comments if you've got any questions! For larger questions, post to stackoverflow.com and link to your question here.
 
Haha, this is SO google. While other companies even charge devs for a few videos and a wiki, big G releases just about everything in order to push the platform and make devs happy. Thanks!
 
Best companion for the summer vacations :-)
 
cloned, can use the responsive design and best practice reference :)
 
FYI, to build it with the latest SDK I had to update the android/build.gradle to point at buildToolsVersion 18.0.1
 
obviously a newbie question but I can't figure it out, but how do i open the Android project in Android Studio? Thanks in advance.
 
+Raist de Jesus, open Android Studio, in the dialog select 'import project', navigate to your iosched folder, double click it, import from Gradle, finish, and you should be good
 
+James Power oh, i should use "Import Project", I kept trying with "Open Project", but I was just getting some skeleton. Thanks!
 
No problem ;)

Android Studio has its own idea of project files etc, which 'Open Project' would open fine. Generally those files are left out of source control as they are specific to a particular tool/IDE and a contributor might be hacking away at this app using ed or something.
 
Thanks Google!  I cloned the app locally and did the import with Android Studio and there are several errors that are related to style for AppCompat.light, any easy suggestions for fixed this?
 
Thanks for sharing ! You guys really need to do something about this google code website situation...
 
Ok!  Did all that..now I get this error on the importing the settings.gradle files:

failed to find Build Tools revision 18.0.0

Consult IDE log for more details (Help | Show Log) 

Thanks for any suggestions! :)
 
+Rio Waller ah you can either download build tools 18.0.0 with the SDK manager or just change the .gradle files to point to 18.0.1 instead of 18.0.0.
 
+Roman Nurik You have been so helpful, thanks for your time!  I did not see the 18.0.0 in the SDK, so I'm attempting to change the build.gradle and inside there of it is classpath 'com.android.tools.build:gradle:0.5.+', so do I change it to 0.0.+?
 
I tried everything, and I couldn't import it,
Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
A problem occurred configuring project ':android'.
A problem occurred configuring project ':android'.
Failed to notify project evaluation listener.
Could not resolve all dependencies for configuration ':android:_DebugCompile'.
Could not find any version that matches com.google.android.gms:play-services:3.1.+.
Required by:
    iosched:android:unspecified

Consult IDE log for more details (Help | Show Log)
any help? thanks
 
Thanks +Roman Nurik I was just wondering about whether you'd release it or not. Timing could not have been better since I am about to start a new project and was looking for some inspiration. 
 
I love this big ipad android so I want to this, but I have no money now?
 
Is it going to be standard to expand swipable tabs into cards when using fragments now? I like it!
 
+Rio Waller no that's actually the gradle plugin version not the build tools version. if you pull the latest changes, the project should now use 18.0.1 which is the latest build tools version
 
Thank you for sharing! I don't see any test classes, is there a separate test project or do you only write correct code ;). I'm a big fan of TDD and hoped to see a 100% TDD Android project someday :D
 
+Roman Nurik you are truly a star. I guess you are doing this as part of your 20% google time ? Anyway, thanks for helping out, easy to see why Android is prospering. 
 
+Holman Calderón I'm having the same problem "Could not find any version that matches com.google.android.gms:play-services:3.1.+.
Required by:
    iosched:android:unspecified" Play services is installed and I've tried to build with android studio and the project root. +Roman Nurik is this a build tools problem as well?
 
notice that all the (sample) source beginning in API 18,  it's becoming the gradle structure and format, it seems to hint that we gotta move into Android Studio fully, and using in Eclipse is no longer possible unless changing the project code structure? (Need someone shed me some lights on this for running the gradle project structure in eclipse.)
 
Will surely check this out for understanding best practice. 
 
Thanks this is awesome. You Android guys should think about releasing a case study for ui design and code for the io app. It has some really useful patterns.
 
Project structure difference main in the src and res file location, if without gradle in eclipse, with minor relocation and recreate the android project in eclipse it still run well too. +Hendra Gunawan . 
 
+Holman Calderón Okay so if you still cant build, go into the build.gradle in the /android/src folder and comment out "compile 'com.google.android.gms:play-services:3.1.+'". Now you should be able to import, to build you have to add the library from android-studio/sdk/extras/google/google_play_services to the /android/libs folder. This allowed me to build.
 
Isn't part of using a build system like Gradle to make it compatible with any IDE that supports that build system? i.e. Android Studio isn't required?

I'm having the same issue as Holman and Connor, but I'd rather understand why it can't find the dependency rather than having to tweak each project like this.

I'm on Linux, I have `ANDROID_HOME` set to point to the SDK, and I was using the gradle wrapper rather than an installed gradle version. I've updated the SDK and have the Play Services lib in the extras directory.

Is it required to manually install it to the `.m2` repository in my home folder before gradle will pick it up?
 
I got an Exception on my phone (API Level 15):

Launch app -> EXPLORE -> Android -> "what's New in Android Developer Tools"

08-02 10:56:53.810 6602-6602/com.google.android.apps.iosched E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ClassCastException: android.widget.ShareActionProvider cannot be cast to android.support.v7.internal.view.menu.MenuItemWrapperICS$ActionProviderWrapper
at android.support.v7.internal.view.menu.MenuItemWrapperICS.getSupportActionProvider(MenuItemWrapperICS.java:311)
at android.support.v7.internal.view.menu.MenuItemWrapperICS.checkActionProviderOverrideVisibility(MenuItemWrapperICS.java:325)
at android.support.v7.internal.view.menu.MenuItemWrapperICS.setActionProvider(MenuItemWrapperICS.java:263)
at com.google.android.apps.iosched.util.SessionsHelper.tryConfigureShareMenuItem(SessionsHelper.java:95)
at com.google.android.apps.iosched.ui.SessionDetailFragment$9.run(SessionDetailFragment.java:585)
at com.google.android.apps.iosched.ui.SessionDetailFragment.tryExecuteDeferredUiOperations(SessionDetailFragment.java:595)
at com.google.android.apps.iosched.ui.SessionDetailFragment.setupShareMenuItemDeferred(SessionDetailFragment.java:589)
at com.google.android.apps.iosched.ui.SessionDetailFragment.onSessionQueryComplete(SessionDetailFragment.java:344)
at com.google.android.apps.iosched.ui.SessionDetailFragment.onLoadFinished(SessionDetailFragment.java:850)
at com.google.android.apps.iosched.ui.SessionDetailFragment.onLoadFinished(SessionDetailFragment.java:67)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:427)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:395)
at android.support.v4.content.Loader.deliverResult(Loader.java:104)
at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:73)
at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:35)
at android.support.v4.content.AsyncTaskLoader.dispatchOnLoadComplete(AsyncTaskLoader.java:223)
at android.support.v4.content.AsyncTaskLoader$LoadTask.onPostExecute(AsyncTaskLoader.java:61)
at android.support.v4.content.ModernAsyncTask.finish(ModernAsyncTask.java:461)
at android.support.v4.content.ModernAsyncTask.access$500(ModernAsyncTask.java:47)
at android.support.v4.content.ModernAsyncTask$InternalHandler.handleMessage(ModernAsyncTask.java:474)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)


Anyone can help?
 
I got an Exception on my phone (API Level 15):

Launch app -> EXPLORE -> Android -> "what's New in Android Developer Tools"

08-02 10:56:53.810 6602-6602/com.google.android.apps.iosched E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ClassCastException: android.widget.ShareActionProvider cannot be cast to android.support.v7.internal.view.menu.MenuItemWrapperICS$ActionProviderWrapper
at android.support.v7.internal.view.menu.MenuItemWrapperICS.getSupportActionProvider(MenuItemWrapperICS.java:311)
at android.support.v7.internal.view.menu.MenuItemWrapperICS.checkActionProviderOverrideVisibility(MenuItemWrapperICS.java:325)
at android.support.v7.internal.view.menu.MenuItemWrapperICS.setActionProvider(MenuItemWrapperICS.java:263)
at com.google.android.apps.iosched.util.SessionsHelper.tryConfigureShareMenuItem(SessionsHelper.java:95)
at com.google.android.apps.iosched.ui.SessionDetailFragment$9.run(SessionDetailFragment.java:585)
at com.google.android.apps.iosched.ui.SessionDetailFragment.tryExecuteDeferredUiOperations(SessionDetailFragment.java:595)
at com.google.android.apps.iosched.ui.SessionDetailFragment.setupShareMenuItemDeferred(SessionDetailFragment.java:589)
at com.google.android.apps.iosched.ui.SessionDetailFragment.onSessionQueryComplete(SessionDetailFragment.java:344)
at com.google.android.apps.iosched.ui.SessionDetailFragment.onLoadFinished(SessionDetailFragment.java:850)
at com.google.android.apps.iosched.ui.SessionDetailFragment.onLoadFinished(SessionDetailFragment.java:67)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:427)
at android.support.v4.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:395)
at android.support.v4.content.Loader.deliverResult(Loader.java:104)
at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:73)
at android.support.v4.content.CursorLoader.deliverResult(CursorLoader.java:35)
at android.support.v4.content.AsyncTaskLoader.dispatchOnLoadComplete(AsyncTaskLoader.java:223)
at android.support.v4.content.AsyncTaskLoader$LoadTask.onPostExecute(AsyncTaskLoader.java:61)
at android.support.v4.content.ModernAsyncTask.finish(ModernAsyncTask.java:461)
at android.support.v4.content.ModernAsyncTask.access$500(ModernAsyncTask.java:47)
at android.support.v4.content.ModernAsyncTask$InternalHandler.handleMessage(ModernAsyncTask.java:474)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)


Anyone can help?
 
is there any ability to use gradle with eclipse for this project?
 
my impression is that circuitous way that enableDisableActivitiesByFormFactor method where UIUtils.java. especcially, condition of enable bool and using PackageManager's setComponentEnabledSettings method. maybe possible easier way. is it inappropriate to think that?
 
I'm  interesting in the G+ stream fragment.  I think it is a bit unfortunate that it relies on intents to allow user to plus/share/reply posts (rather then doing so within the app itself) but I guess that simplifies things a lot.
 
I see lots of references to Android Studio - will I be able to use this with Eclipse w/o too much trouble?  Has anyone shared an Eclipse project version of this?
 
Sorry, I cannot understand... When I push the button "Add account" on emulator nothing happens... What should I do to use this application?

 
+Holman Calderón Did you solve this problem? I also faced the same issue and i confirm that i have install all the tools, extras libs and sdk 18.
I have tried to remove this two line text
compile 'com.google.android.gms:play-services:3.1.+'
    compile 'com.android.support:appcompat-v7:18.0.0'
but, it still show me error notice: failed to find target android-18
 
+Diaoxiang Wei +Holman Calderón I was facing the same problems as you are. After spending few hours, I finally figured out a very simple way to fix the issue. Following are the steps.

1. Remove all your existing code for iosched. Unzip the latest code to the desired location.
2. Determine the version of com.google.android.gms:play-services from your sdk (i.e. at following path <android sdk>\extras\google\google_play_services\libproject\google-play-services_lib\AndroidManifest.xml. In my case, it is 3.2.25)
3. Now open the ioschediosched-8ae851b7909c\android\build.gradle file in a text editor, update the entry as following

compile 'com.google.android.gms:play-services:3.2.+'

Save the file and close it.
4. Open Android Studio, click on import project, select the ioschediosched-8ae851b7909c\settings.gradle and click OK.

Now your project should open as well as build successfully. Enjoy!!
 
+Nishant Patel Currently, i am use ubuntu 13.04. Java sdk 1.7
the google play services version in my sdk is 3.2.25,same to you.
But after i change the build.gradle file as "compile 'com.google.android.gms:play-services:3.2.+'". It still show the error can not find play-services:3.2+
But in my mac, i just download androidstudio and update it, after install all the sdk . Then it can import it and work well.
 
+Diaoxiang Wei I'm not sure if you are trying my solution to an already imported project or it is from the scratch.

Please note, the change I mentioned should be done before importing the project the studio. This is because Android studio (i.e. using gradle) tries to add references of the missing libraries while import using the build.gradle file.
 
+Roman Nurik I noticed that the app highlights list item "selections". This is what I want too. But the only thing I get with selectors is the pressed state. When pressing a list item, I see its selector background, but when releasing the item is not selected anymore.

I read Romain Guy's post on "Touch Mode" at http://android-developers.blogspot.de/2008/12/touch-mode.html where he states "Do not try to keep the focus or selection in touch mode". Did this statement change? Is it "officially" ok now? And how did you guys make the selection (background) persist? I checked our the code but could not find the solution.
 
+Nishant Patel After i clean uninstall android studio. (removed the .gradle and .AndroidStudioPreview) and install the android studio again. Got error notice :
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
A problem occurred configuring project ':android'.
A problem occurred configuring project ':android'.
Failed to notify project evaluation listener.
Could not resolve all dependencies for configuration ':android:_DebugCompile'.
Could not find any version that matches com.google.android.gms:play-services:3.+.
Required by:
    iosched:android:unspecified
 
Is there any extra settings for android studio? following BUILDING.txt in this project seem to be not work. I even downloaded both google and android repository in android-sdk\extra  but didn't work.
 
At last i found the reason why i cannot import. i change file local.properties.example -> local.properties and change the content of this file sdk.dir=C\:/Android/android-studio/sdk. then it imported ok without any error. Maybe this is very basic, but im quite new to gradle-based project.anyway very happy with this.Hope this help.
 
+Holman Calderón, +Conner Brooks and +Diaoxiang Wei, I was facing the same issue, and discovered the issue: I have different Android-sdk installation in my pc, and the ANDROID_HOME system variable was not pointing to the right one.

So, set your ANDROID_HOME system variable to your sdk folder.

Hope it helps.
 
+Holman Calderón, +Conner Brooks and +Diaoxiang Wei, I was facing the same issue, and discovered the issue: I have different Android-sdk installation in my pc, and the ANDROID_HOME system variable was not pointing to the right one.

So, set your ANDROID_HOME system variable to your sdk folder.

Hope it helps.
 
I have a very different problem which is not faced by anyone here. when I want to import the project in the configure state it says:

com.android.builder.model.AndroidLibrary.getProject()Ljava/lang/String;
Consult IDE log for more details (Help | Show Log)

Can anyone please help me to resolve this issue?
 
My problem is also different and I returned the following error:
Gradle: Execution failed for task ': android: compileDebug'.
> Compilation failed; see the compiler errors output for details.

C: \ Documents and Settings \ User \ My
Gradle: error: can not find symbol class OnPersonLoadedListener
Gradle: error: method does not override or in Place a method from a supertype
Gradle: error: can not find symbol method loadPerson (AccountActivity, String)


C: \ Documents and Settings \ User \ My
Gradle: error: no suitable method found for initialize (PlusClient, String, <null>)
Gradle: error: no suitable method found for initialize (PlusClient, String, <null>)
PlusOneButton.initialize method (String, OnPlusOneClickListener) is not applicable
Gradle: error: no suitable method found for initialize (PlusClient, String, <null>)
PlusOneButton.initialize method (String, OnPlusOneClickListener) is not applicable
(present and formally Differ in length argument lists)
Gradle: error: no suitable method found for initialize (PlusClient, String, <null>)
PlusOneButton.initialize method (String, OnPlusOneClickListener) is not applicable
(present and formally Differ in length argument lists)
PlusOneButton.initialize method (String, int) is not applicable
Gradle: error: no suitable method found for initialize (PlusClient, String, <null>)
PlusOneButton.initialize method (String, OnPlusOneClickListener) is not applicable
(present and formally Differ in length argument lists)
PlusOneButton.initialize method (String, int) is not applicable
(present and formally Differ in length argument lists)
 
Hello all, I have had problems with building this solution like many else here, but I managed to resolve them by following comments.
My question is are there any documents accompanying the app, there are some techniques here that I don't know of and it would be easier if I had some explanations other than plain code. Any suggestions on what to read in order to better understand those "better practices" mentioned in the post?

Thanks
Add a comment...