alexander shitikov: cross platform mobile development. business logic for mobile applications

24
CROSS-PLATFORM MOBILE DEVELOPMENT Alexander Shitikov Head of mobile development department

Upload: mobile-trends

Post on 08-Jan-2017

239 views

Category:

Mobile


2 download

TRANSCRIPT

Page 1: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

CROSS-PLATFORM MOBILE DEVELOPMENT

Alexander ShitikovHead of mobile development department

Page 2: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

HYBRID APPLICATIONS

Page 3: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

TECHNOLOGIES

Page 4: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

BUSINESS LOGIC

Shared logic

for each platform

Page 5: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

BUSINESS LOGIC

Page 6: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

BUSINESS LOGIC

Page 7: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

JAVA AS THE BRIDGE

Page 8: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

CHALLENGES

• To create cross-platform mobile business logic library on Java

• To give fully-native interface to developers to interact with it

Page 9: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

SOLUTION

• RoboVM

• Objective-C JNI wrapper generator

Page 10: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

FEATURES

• Memory management

• Threading

• Namespaces

• Inheritance

• Mapping

• Overloading

• Exceptions

Page 11: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

MEMORY MANAGEMENT

• Java object from native

• Native object from java

Page 12: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

THREADING

• Control by java

• Control by native

Page 13: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

NAMESPACES

java.lang.String -> MTCString

Problem:pl.mobiletrends.String -> MTCString

Page 14: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

NAMESPACES

java.lang.String -> java_lang_String

Page 15: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

NAMESPACES

java.lang.String -> JavaLangString

Page 16: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

NAMESPACES

java.lang.String -> MTCJLString

Page 17: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

INHERITANCE AND MAPPING

• class -> @interface

• interface -> @protocol

• boolean -> bool

• byte -> char

• …

• Int[] -> PrimitiveIntArray

• Int[][] -> NSArray<PrimitiveIntArray>

• Object -> MTCObject

Page 18: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

INHERITANCE ARTIFACT

public Animal getAnimal() { … }

- (MTCAnimal *)getAnimal;

MTC + Animal.getClass().getShortName()

Page 19: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

MAPPING EXAMPLE

public String getTestString() {return “Hello, World!”;

}public int[] getGivenArray(int[] array) {

return array;}

- (MTCString *)getTestString;

- (PrimitiveIntArray *)getGivenArray:(PrimitiveIntArray *)array;

Page 20: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

OVERLOADING CHALLENGES

public void overload(int a) {…

}public void overload(int[] a) {

…}

- (void)overload:(int)a;

- (void)overload:(PrimitiveIntArray *)a;

Page 21: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

OVERLOADING SOLUTION

public void overload(int a) {…

}public void overload(int[] a) {

…}

- (void)overloadWithAint:(int)a;

- (void)overloadWithAintArray:(PrimitiveIntArray *)a;

Page 22: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

EXCEPTIONS

public static void throwException() {

throw new NullPointerException(“MTC 2016”);}

+ (void)throwException;…@try {

[MTCCustomClass throwException]} @catch (MTCNullPointerException *e) {

...} @finally { ... }

Page 23: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

PROJECT STATUS

March-April 2016 alpha version

Page 24: Alexander Shitikov: Cross Platform Mobile Development. Business Logic for mobile applications

mobile.agima.ru +7 495 981-01-85 [email protected]

THANK YOU FOR ATTENTION!

Alexander ShitikovHead of mobile development department

facebook.com/shitikov.ap