porting hotels.com to nokia x

Post on 15-Jan-2015

232 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Sharing my experience and learnings from porting our Hotel.com to the Nokia X platform as a pre-release partner with Nokia

TRANSCRIPT

1

Porting to Nokia X

Maciej Matyjas – Mobile Technology Lead - @matyjas

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

3

About Me

• Does not work for Nokia©• Pisces• Shipped Meego apps• Enjoys long walks on the beach

4

About Nokia X

• AOSP• Plus• Single back button• Nokia Here Maps• Nokia In-App Payments• Nokia Notifications• Fastlane UI

5

About Nokia X’s Fastlane UI

6

About Nokia X

• No GMS• Targets users between Asha and Lumia ranges• Combines aspects of• Asha• Meego• WinPhone• Android

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

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”

9

Port that App

10

Go AOSP

• Make sure your ‘Project Build Target’ is AOSP• Ship?

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

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

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

Here Maps for Google Maps v2

// mm:: particularly insidious since on bg

if (map.getProjection().getVisibleRegion() != null) { LatLngBounds bounds = map.getProjection() .getVisibleRegion() .latLngBounds; … }

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; }

16

Here Maps for Google Maps v2

• That is it!• Lets demo

17

Here Maps for Google Maps v2

18

Here Maps for Google Maps v2

19

Here Maps for Google Maps v2

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

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

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

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

24

Questions?

Maciej Matyjas – Mobile Technology Lead - @matyjas

25

top related