On Thursday I went to the Motorola's MOTODEV. You can find a review of the event here. Thanks @fogo!
One of the sessions was called: "Moving Your Smartphone App to the Tablet". There they showed an app done in Argentina which was ported to tablets. My first thought was: "Cool, someone already ported something here in Argentina". Today I installed it and I found very interesting stuff in this app so I decided to create a review.
Installation and market place
I search for the app in the market and I found this:
This is what happens when you use two different binaries for the same app. Some of the issues are:
- Different comments for the same app.
- Different ratings for the same app.
- Doing an update means uploading two different apps.
Is there a real difference between those binaries? We will see.
Patterns and features explained
In this section I will explain some of the patterns that the app uses. Also some features/issues and a way to solve them.
Splash Screen
This is something used a lot in iPhone's app. While an app loads in iPhone the os shows the image /Default.png or /Default@2x.png. It does make sense to use a splash screen if you need to load something before loading the application itself. One of the best examples is Roboguice's RoboSplashActivity:
An activity that can be used to display a splash page while initializing the guice injector in the background.
To use this kind of patterns the attribute android:noHistory is your friend. In the case of the app it looks like they didn't use it since there is a nasty bug that ends in a FC. If you enter the app and click "ProgramaciĆ³n" you can actually move back three steps when only two should be possible.
AndroidManifest
If you check their manifest you will notice that they are doing something like:
<activity android:label="@string/app_name" android:name=".ESPN_107_9" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
intent-filter>
activity>
<activity android:name=".EspnHome" android:screenOrientation="portrait" />
<activity android:name=".EspnProgramacion" android:screenOrientation="portrait" />
<activity android:name=".EventoActivity" android:screenOrientation="portrait" />
<activity android:name=".Prueba" android:screenOrientation="portrait" />
<activity android:name="iphoideas.ESPN_107_9_TABLET.Example" android:screenOrientation="portrait" />
Some issues about this manifest:
- It doesn't follow the java package name convention.
- There is an android:screenOrientation="portrait" in every Activity when it can be placed just in the Application tag.
There is also an interesting use of android:name. In the manifest you can place a dot and that will be replaced by the package info placed in the manifest tag. As you can see, they have used both ways. The complete package name and the dot version.
Forced Portrait
This is what pissed me off as a user. No landscape view in the tablet version? Seriously?
The app has basically two Activities. The main one with a play button and some social features.
Social features
You can just send an email or paste something in your facebook's wall. Android has a lovely share intent to handle this stuff. You can get more information here.
System notification when playing
I started playing the radio and no system notification was shown. Not the same use case as the default music player?
Fragments
No fragments? Honeycomb application without fragments? I don't like to have a big play button in the main window and need to move to something else just to see the radio guide.
Creating a landscape layout having the radio controls in the same activity as the guide would have been great.
Stacked activities
In this app from the Home you can go to the radio guide and from the radio guide you can go to the home screen. So, you basically can do Home => Radio Guide => Home => Radio Guide. What happens if you press the back button? In this particular app all the activities get stacked but for this kind of situations android provides a solution. Using FLAG_ACTIVITY_CLEAR_TOP
For example, consider a task consisting of the activities: A, B, C, D. If D calls startActivity() with an Intent that resolves to the component of activity B, then C and D will be finished and B receive the given Intent, resulting in the stack now being: A, B.
Enable Hardware acceleration
Unfortunately this app doesn't use it. To do it you just need to add the android:hardwareAccelerated="true" in the application element.
Using the Holographic theme
This app doesn't use the holographic theme. Everything in this app is custom so you might thing that it's not necessary but when dialog show up they aren't custom and they don't use honeycomb styles.
If you are targeting smartphone and tablet you can use:
<uses-sdk minsdkversion="4" targetsdkversion="11"></uses-sdk>
Different resources for different screen sizes and densities
This app has every resource inside the res/drawable folder. Using the res folder correctly would be enough for this app to live in the same binary. There is a nice explanation about this here.
Conclusion
The conclusion is dead simple. This is not a honeycomb app. It works in honeycomb because it has: <uses-sdk android:minSdkVersion="7" />. It isn't targeted for Honeycomb and it doesn't use android 3.0 features.
Does anyone know if someone in Argentina already did a good honeycomb app?
Great post!
ReplyDelete