porting hotels.com to nokia x

25
1 Porting to Nokia X Maciej Matyjas – Mobile Technology Lead - @matyjas

Upload: maciej-matyjas

Post on 15-Jan-2015

231 views

Category:

Technology


0 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Porting Hotels.com to Nokia X

1

Porting to Nokia X

Maciej Matyjas – Mobile Technology Lead - @matyjas

Page 2: Porting Hotels.com to Nokia X

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

Page 3: Porting Hotels.com to Nokia X

3

About Me

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

Page 4: Porting Hotels.com to Nokia X

4

About Nokia X

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

Page 5: Porting Hotels.com to Nokia X

5

About Nokia X’s Fastlane UI

Page 6: Porting Hotels.com to Nokia X

6

About Nokia X

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

Page 7: Porting Hotels.com to Nokia X

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?

Page 8: Porting Hotels.com to Nokia X

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”

Page 9: Porting Hotels.com to Nokia X

9

Port that App

Page 10: Porting Hotels.com to Nokia X

10

Go AOSP

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

Page 11: Porting Hotels.com to Nokia X

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?

Page 12: Porting Hotels.com to Nokia X

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

Page 13: Porting Hotels.com to Nokia X

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

Page 14: Porting Hotels.com to Nokia X

14

Here Maps for Google Maps v2

// mm:: particularly insidious since on bg

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

Page 15: Porting Hotels.com to Nokia X

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

Page 16: Porting Hotels.com to Nokia X

16

Here Maps for Google Maps v2

• That is it!• Lets demo

Page 17: Porting Hotels.com to Nokia X

17

Here Maps for Google Maps v2

Page 18: Porting Hotels.com to Nokia X

18

Here Maps for Google Maps v2

Page 19: Porting Hotels.com to Nokia X

19

Here Maps for Google Maps v2

Page 20: Porting Hotels.com to Nokia X

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

Page 21: Porting Hotels.com to Nokia X

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

Page 22: Porting Hotels.com to Nokia X

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.**

Page 23: Porting Hotels.com to Nokia X

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

Page 24: Porting Hotels.com to Nokia X

24

Questions?

Maciej Matyjas – Mobile Technology Lead - @matyjas

Page 25: Porting Hotels.com to Nokia X

25