2. l Kenichi Kambara (Twitter @korodroid)
l iplatform.org(http://www.iplatform.org/) (Personal)
l NTT Software Corporation (Official)
2
l Activity(iplatform.org as Personal)
9 10
Who am I?
- My Android Apps on Google Play (20+ Apps)
l Activity(NTT Software as Official)
- Technical Support for Developing
3. 3
l Kenichi Kambara (Twitter @korodroid)
l iplatform.org(http://www.iplatform.org/) (Personal)
l NTT Software Corporation (Official)
Who am I?
l Activity(iplatform.org as Personal)
9 10
“Sekai Phone”
lGoogle Developer Day 2011 Tokyo Keynote Demo
lMulti Screen UX Competition 2013 Excellence Awards
lMobile World Congress 2013 Exhibition
4. 4
l Kenichi Kambara (Twitter @korodroid)
l iplatform.org(http://www.iplatform.org/) (Personal)
l NTT Software Corporation (Official)
Who am I?
l Activity(iplatform.org as Personal)
New Sekai Phone
Available Today!!!
*Special Thanks: Kenichi Takahashi
lImproved UI / UX
lImproved Usability
lMultiVersions & Devices
5. 5
Agenda
•Introduction (+ Sekai Phone)
•Background
•Application Development Tips
Q. How to support Multiple Screens?
Q. How to support Multiple Versions?
6. 6
2.x 3.x 4.x
My session topics
Some tips on developing Apps
for multi versions and multi devices.
Handsets Tablets
8. 8
What is “Sekai Phone”?
Chinese
Japanese
French
Italian
○
English German
○ ○
○
○
Real time translation phone services
(Supports Android 2.x/3.x/4.x & multi devices)
Publish Date: Jan, 2010, over 20+ ver.up
9. 9
Use Case (1)
Phone mode
(Auto translating to receiver’s native language)
French Japanese
10. 9
Use Case (1)
Phone mode
(Auto translating to receiver’s native language)
Bonjour!
French Japanese
11. 9
Use Case (1)
Phone mode
(Auto translating to receiver’s native language)
Konnichiwa!Bonjour!
French Japanese
12. 9
Use Case (1)
Phone mode
(Auto translating to receiver’s native language)
Konnichiwa!
Arigatou!
Bonjour!
French Japanese
13. 9
Use Case (1)
Phone mode
(Auto translating to receiver’s native language)
Konnichiwa!
Merci! Arigatou!
Bonjour!
French Japanese
21. 17
PlatformVersions?
In my App:
Main Target: Android 2.2+ (2.2,2.3,3.x,4.x)
This data by Google on June 3, 2013
ICS
JB
Eclair
Froyo
Gingerbread
Honeycomb
22. 18
Screen Sizes & Densities?
This data by Google on June 3, 2013
Normal
Small
Xlarge
Large
hdpi
xhdpi
ldpi
mdpi
xxhdpi
tvdpi
23. 19
Screen Sizes & Densities?
In my App:
My Target: (normal,large,xlarge)x(mdpi,hdpi,xhdpi,xxhdpi)
This data by Google on June 3, 2013
25. 21
l How to support Multiple Screens
Support multi versions and multi devices?
1.Designing User Interface
2.Using APIs
l How to support Multiple Versions
30. 26
[UI]2nd Approach
Using sw<N>dp,w<N>dp,h<N>dp
l Recommended by Google
l Supports only Android 3.2+
layout/
main.xml
Handsets Tablet (‘’7) Tablet (‘’10)
layout-sw600dp/
main.xml
layout-sw720dp/
main.xml
31. 27
[UI]3rd Approach
Combination of 1st and 2nd
l Supports Android 1.6
l Supports many devices (compared to 1st or 2nd)
l Any Problem?
l res/layout-sw600dp/main.xml <- 3.2+ tablets
l res/layout-xlarge/main.xml <- 3.0/3.1 tablets
l res/layout/main.xml <- The others (Handsets)
32. 28
[UI]3rd Approach
It looks good but…
l res/layout-sw600dp/main.xml <- 3.2+ tablets
l res/layout-xlarge/main.xml <- 3.0/3.1 tablets
l res/layout/main.xml <- The others (Handsets)
• Needs to put the same file for tablets.
(Maintenance headache…)
33. 29
[UI]3rd Approach
It looks good but…
if ([Size is xlarge] or [width & height is at least 600dp])
// codes for tablets
}else{
// codes for others
}
• Complicated Java codes
(Development is complicated…)
35. 31
[UI]4th Approach
Based on 3rd , plus some tips
l main_1pane.xml <- Handsets
l main_2panes.xml <- Tablets
layout
Put minimum requirement
layout files
44. 40
[API]Fragment
Comparing Using with No-Using
With
Support Library
Without
Support Library
Class
•android.support.v4.Fragment
•android.support.v4.FragmentActivity
…
•android.app.Fragment
•android.app.Activity
…
Method
•getSupportFragmentManager()
(FragmentActivity)
…
•getFragmentManager()
(Activity)
…
45. 41
[API]Options Menu vs Action Bar
Action Bar is good…
2.x 3.x 4.x
Options Menu
Action Bar
2.x 3.x
4.x
46. 42
[API]Supporting Daydream
Daydream is attractive, but 4.2 API
Your App
• 4.2+ devices can run Daydream
Older devices can run normally
except Daydream
XXClass
extends
DreamService
Android
Manifest.xml
add
modify
48. 44
[API]Multi-Versioning
How to use the newest API on Single APK
Well known approachReflection
One of design patterns
•SuppressLint("NewApi")
•@TargetApi(n)
Configuring Lint
Lazy Loading
50. 46
[API]Multi-Versioning
Code Examples of “Lazy loading”
public
abstract
class
NotificationUtilAbstract
{
public
static
NotificationUtilAbstract
newInstance()
{
NotificationUtilAbstract
instance
=
null;
if
(Integer.parseInt(Build.VERSION.SDK)>=
16)
{
instance
=
new
NotificationUtilJB();
}
else
{
instance
=
new
NotificationUtilDefault();
}
return
instance;
}
public
abstract
void
showCaller;
}
1st step
51. 47
[API]Multi-Versioning
public
class
NotificationUtilJB
extends
NotificationUtilAbstract{
@Override
public
void
showCaller(){
//
Code
by
Jelly
Bean
(API
16)
}
}
public
class
NotificationUtilDefault
extends
NotificationUtilAbstract{
@Override
public
void
showCaller(){
//
Code
by
Old
API
}
}
Compatible
2nd step
52. 48
[API]Multi-Versioning
How to use the newest API on Single APK
Well known approachReflection
In my App:
Compatibility with Lazy loading & Configuring Lint
One of design patterns
•SuppressLint("NewApi")
•@TargetApi(11)
Configuring Lint
Lazy Loading