2. 2
Porting to Nokia X
• About Me
• About Nokia X
• Secret Devices and NDAs
• Firmware Updates
• Go AOSP
• Here™ Maps for Google Maps v1
• Here™ Maps for Google Maps v2
• Analytics
• Publishing & Proguard
• Wrap up
6. 6
About Nokia X
• No GMS
• Targets users between Asha and Lumia ranges
• Combines aspects of
• Asha
• Meego
• WinPhone
• Android
7. 7
Secret Devices and NDAs
• Need to know basis
• Identifying allies
• Chinese walls
• Stealthy intelligence gathering
• Cloak and dagger with the Analytics team
• Is our Build Manager a double agent?
8. 8
Firmware Updates
• Constantly updating firmware
• Reconnect to network, enable location, etc
• Always a little worried of brickwareing
• Never sure if it was something I did or the
firmware
• “Blame it on the firmware, cos the firmware don‟t
care”
11. 11
Here Maps for Google Maps v1
• Manifest mods
• Add “com.google.android.maps.sdk.jar” from
Nokia
• Make sure its exported with your .apk file
• Ship?
12. 12
Here Maps for Google Maps v2
• Not moving as quickly as Google‟s releases
• Same manifest mods
• Replace Google Play Services library project
with reference_v2_lib
• Add isMapsV2EquivalentAvailable() to our
GooglePlayServicesChecker.java
• Few cases where initialization order differs to
Google‟s Maps v2
13. 13
Here Maps for Google Maps v2
public void add(GoogleMap map,
MarkerDataHolder holder) {
…
// mm:: visible region might be null if this is
// called before map is visible
if ((map.getProjection().getVisibleRegion()
!= null)
&& (map.getProjection().getVisibleRegion()
.latLngBounds.contains(position))) {
markers.add(
map.addMarker(holder.getMarkerOpts()));
}
}
14. 14
Here Maps for Google Maps v2
// mm:: particularly insidious since on bg
if (map.getProjection().getVisibleRegion()
!= null) {
LatLngBounds bounds =
map.getProjection()
.getVisibleRegion()
.latLngBounds;
…
}
15. 15
Here Maps for Google Maps v2
@Override
public View getInfoWindow(Marker marker) {
…
// mm:: this works around an issue
// rendering InfoWindows on Here maps
mContents.setLayoutParams(
new ViewGroup.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
return mContents;
}
20. 20
Analytics
1. Debrei Tamás: open config.xml in hotels-logic-
library
2. Debrei Tamás: <confvalue key =
"APP_STORE_NAME" value = "GOOGLE"/>
3. Debrei Tamás: replace GOOGLE with
NONBRAND
21. 21
Publishing & Proguard
• A little tricky due to maps wrappers
• Couldn‟t exactly Google for „Nokia secret
Android platform maps wrapper Proguard setup‟
• Or ask on Stack Overflow
• But Nokia support was terrific
22. 22
Publishing & Proguard
# here maps
-keep class com.nokia.** { *; }
-keep interface com.nokia.** { *; }
-dontwarn com.nokia.**
-keep class com.here.** { *; }
-keep interface com.here.** { *; }
-dontwarn com.here.**
# u might also need to tell Proguard to leave the wrapper API intact w/:
-keep class com.google.android.gms.maps.** { *; }
-keep interface com.google.android.gms.maps.** { *; }
-dontwarn com.google.android.gms.maps.**
# here maps v1
-keep public class com.google.android.maps.Projection
-dontwarn com.google.android.maps.PixelConverter
-dontwarn com.google.android.maps.MapView
-keep class com.google.**
-dontwarn com.google.**
23. 23
Wrap Up
• Easiest is if you have no Google dependencies
• Easy if you just use Google Maps v1
• Maps v2 makes it a bit harder
• Probably harder still the tighter you are tied to
Google
• Consider a generic maps solution