SlideShare a Scribd company logo
1 of 13
Download to read offline
Native Payment - Part III
Before We Begin
✦ Send a build with include source and open the
source in the native IDE then do the implementation
there, once done copy the code back to the native
directory
✦ Be aware of threads. Go into the native thread and
don’t forget to go back to the EDT in the callback!
© Codename One 2017 all rights reserved
final Activity act = AndroidNativeUtil.getActivity();
act.runOnUiThread(new Runnable() {
public void run() {
DropInRequest dropInRequest = new DropInRequest()
.clientToken(param);
AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act),
new IntentResultListener() {
public void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
BraintreePaymentCallback.onPurchaseSuccess(
result.getPaymentMethodNonce().getNonce());
} else if (resultCode == Activity.RESULT_CANCELED) {
BraintreePaymentCallback.onPurchaseCancel();
} else {
Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR);
BraintreePaymentCallback.onPurchaseFail(error.toString());
Log.e(error);
Log.sendLog();
}
}
});
}
});
Android
final Activity act = AndroidNativeUtil.getActivity();
act.runOnUiThread(new Runnable() {
public void run() {
DropInRequest dropInRequest = new DropInRequest()
.clientToken(param);
AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act),
new IntentResultListener() {
public void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
BraintreePaymentCallback.onPurchaseSuccess(
result.getPaymentMethodNonce().getNonce());
} else if (resultCode == Activity.RESULT_CANCELED) {
BraintreePaymentCallback.onPurchaseCancel();
} else {
Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR);
BraintreePaymentCallback.onPurchaseFail(error.toString());
Log.e(error);
Log.sendLog();
}
}
});
}
});
Android
Activity
Almost all Android Sample code
assumes this==activity. In a native
interface that just isn’t true which is
why in most cases where this is
referenced you can just do getActivity
using AndroidNative Util
final Activity act = AndroidNativeUtil.getActivity();
act.runOnUiThread(new Runnable() {
public void run() {
DropInRequest dropInRequest = new DropInRequest()
.clientToken(param);
AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act),
new IntentResultListener() {
public void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
BraintreePaymentCallback.onPurchaseSuccess(
result.getPaymentMethodNonce().getNonce());
} else if (resultCode == Activity.RESULT_CANCELED) {
BraintreePaymentCallback.onPurchaseCancel();
} else {
Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR);
BraintreePaymentCallback.onPurchaseFail(error.toString());
Log.e(error);
Log.sendLog();
}
}
});
}
});
Android
UI Thread
Most Android sample code assumes
you are on the Android equivalent of the
EDT (UI thread). We are on the
Codename One EDT or a Codename
One thread in a native interface so it’s
best to do something like this unless
you need a synchronous call
final Activity act = AndroidNativeUtil.getActivity();
act.runOnUiThread(new Runnable() {
public void run() {
DropInRequest dropInRequest = new DropInRequest()
.clientToken(param);
AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act),
new IntentResultListener() {
public void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
BraintreePaymentCallback.onPurchaseSuccess(
result.getPaymentMethodNonce().getNonce());
} else if (resultCode == Activity.RESULT_CANCELED) {
BraintreePaymentCallback.onPurchaseCancel();
} else {
Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR);
BraintreePaymentCallback.onPurchaseFail(error.toString());
Log.e(error);
Log.sendLog();
}
}
});
}
});
Android
startActivityForResult
This is a very common method of
activity but grabbing the result isn’t
intuitive which is why we have this
method
final Activity act = AndroidNativeUtil.getActivity();
act.runOnUiThread(new Runnable() {
public void run() {
DropInRequest dropInRequest = new DropInRequest()
.clientToken(param);
AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act),
new IntentResultListener() {
public void onActivityResult (int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT);
BraintreePaymentCallback.onPurchaseSuccess(
result.getPaymentMethodNonce().getNonce());
} else if (resultCode == Activity.RESULT_CANCELED) {
BraintreePaymentCallback.onPurchaseCancel();
} else {
Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR);
BraintreePaymentCallback.onPurchaseFail(error.toString());
Log.e(error);
Log.sendLog();
}
}
});
}
});
Android
Callbacks & API
On Android we can access the
Codename One API directly since it’s all
just Java…
dispatch_async(dispatch_get_main_queue(), ^{
BTDropInRequest *request = [[BTDropInRequest alloc] init];
BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request
handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError *
_Nullable error) {
if (error != nil) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST
ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]));
} else if (result.cancelled) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE
_ARG);
} else {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET
_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce));
}
[controller dismissViewControllerAnimated:YES completion:nil];
}];
[[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES
completion:nil];
});
iOS
dispatch_async(dispatch_get_main_queue(), ^{
BTDropInRequest *request = [[BTDropInRequest alloc] init];
BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request
handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError *
_Nullable error) {
if (error != nil) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST
ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]));
} else if (result.cancelled) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE
_ARG);
} else {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET
_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce));
}
[controller dismissViewControllerAnimated:YES completion:nil];
}];
[[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES
completion:nil];
});
iOS
iOS EDT
iOS is very sensitive to EDT violations.
It’s really important to use it’s main
queue (native EDT) for everything
related to UI
dispatch_async(dispatch_get_main_queue(), ^{
BTDropInRequest *request = [[BTDropInRequest alloc] init];
BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request
handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError *
_Nullable error) {
if (error != nil) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST
ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]));
} else if (result.cancelled) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE
_ARG);
} else {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET
_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce));
}
[controller dismissViewControllerAnimated:YES completion:nil];
}];
[[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES
completion:nil];
});
iOS
Self
Self is the Objective-C equivalent of
this. In the original code self was used
as it was assumed to be a Controller
(commonly used iOS abstraction) when
you need a controller you can use this
syntax
dispatch_async(dispatch_get_main_queue(), ^{
BTDropInRequest *request = [[BTDropInRequest alloc] init];
BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request
handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError *
_Nullable error) {
if (error != nil) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST
ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription]));
} else if (result.cancelled) {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE
_ARG);
} else {
com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET
_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce));
}
[controller dismissViewControllerAnimated:YES completion:nil];
}];
[[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES
completion:nil];
});
iOS
Callbacks
Callbacks to Java code are complex
and have a slightly different syntax
when calling to a no-args method but
IDE completion should help…
What did we learn?
✦Native interfaces aren’t trivial, but are doable when
we overcome the pitfalls and use Google
aggressively
✦Error logs on Android are painful and we need to
develop reading skill to go thru them
✦Use native IDE’s to develop the native code and
shorten the back and forth cycles
Thank You!

More Related Content

Similar to Native Payment - Part 3.pdf

A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo Ali Parmaksiz
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript FunctionsColin DeCarlo
 
N Things You Don't Want to Repeat in React Native
N Things You Don't Want to Repeat in React NativeN Things You Don't Want to Repeat in React Native
N Things You Don't Want to Repeat in React NativeAnton Kulyk
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mockskenbot
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesMichael Galpin
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every dayVadym Khondar
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonfNataliya Patsovska
 
The evolution of redux action creators
The evolution of redux action creatorsThe evolution of redux action creators
The evolution of redux action creatorsGeorge Bukhanov
 
BLoC - Be Reactive in flutter
BLoC - Be Reactive in flutterBLoC - Be Reactive in flutter
BLoC - Be Reactive in flutterGiacomo Ranieri
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - TransactionsDmitry Buzdin
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleMathias Seguy
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsEvangelia Mitsopoulou
 
How Reactive do we need to be
How Reactive do we need to beHow Reactive do we need to be
How Reactive do we need to beJana Karceska
 
A Journey with React
A Journey with ReactA Journey with React
A Journey with ReactFITC
 
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationDan Wahlin
 

Similar to Native Payment - Part 3.pdf (20)

A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript Functions
 
N Things You Don't Want to Repeat in React Native
N Things You Don't Want to Repeat in React NativeN Things You Don't Want to Repeat in React Native
N Things You Don't Want to Repeat in React Native
 
Imagine a world without mocks
Imagine a world without mocksImagine a world without mocks
Imagine a world without mocks
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every day
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonf
 
The evolution of redux action creators
The evolution of redux action creatorsThe evolution of redux action creators
The evolution of redux action creators
 
Side effects-con-redux
Side effects-con-reduxSide effects-con-redux
Side effects-con-redux
 
Clean Test
Clean TestClean Test
Clean Test
 
BLoC - Be Reactive in flutter
BLoC - Be Reactive in flutterBLoC - Be Reactive in flutter
BLoC - Be Reactive in flutter
 
mobl
moblmobl
mobl
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - Transactions
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification Google
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
 
Battle of React State Managers in frontend applications
Battle of React State Managers in frontend applicationsBattle of React State Managers in frontend applications
Battle of React State Managers in frontend applications
 
How Reactive do we need to be
How Reactive do we need to beHow Reactive do we need to be
How Reactive do we need to be
 
A Journey with React
A Journey with ReactA Journey with React
A Journey with React
 
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS ApplicationBuilding an End-to-End AngularJS Application
Building an End-to-End AngularJS Application
 

More from ShaiAlmog1

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfShaiAlmog1
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfShaiAlmog1
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfShaiAlmog1
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfShaiAlmog1
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfShaiAlmog1
 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Native Payment - Part 3.pdf

  • 1. Native Payment - Part III
  • 2. Before We Begin ✦ Send a build with include source and open the source in the native IDE then do the implementation there, once done copy the code back to the native directory ✦ Be aware of threads. Go into the native thread and don’t forget to go back to the EDT in the callback! © Codename One 2017 all rights reserved
  • 3. final Activity act = AndroidNativeUtil.getActivity(); act.runOnUiThread(new Runnable() { public void run() { DropInRequest dropInRequest = new DropInRequest() .clientToken(param); AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act), new IntentResultListener() { public void onActivityResult (int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT); BraintreePaymentCallback.onPurchaseSuccess( result.getPaymentMethodNonce().getNonce()); } else if (resultCode == Activity.RESULT_CANCELED) { BraintreePaymentCallback.onPurchaseCancel(); } else { Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR); BraintreePaymentCallback.onPurchaseFail(error.toString()); Log.e(error); Log.sendLog(); } } }); } }); Android
  • 4. final Activity act = AndroidNativeUtil.getActivity(); act.runOnUiThread(new Runnable() { public void run() { DropInRequest dropInRequest = new DropInRequest() .clientToken(param); AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act), new IntentResultListener() { public void onActivityResult (int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT); BraintreePaymentCallback.onPurchaseSuccess( result.getPaymentMethodNonce().getNonce()); } else if (resultCode == Activity.RESULT_CANCELED) { BraintreePaymentCallback.onPurchaseCancel(); } else { Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR); BraintreePaymentCallback.onPurchaseFail(error.toString()); Log.e(error); Log.sendLog(); } } }); } }); Android Activity Almost all Android Sample code assumes this==activity. In a native interface that just isn’t true which is why in most cases where this is referenced you can just do getActivity using AndroidNative Util
  • 5. final Activity act = AndroidNativeUtil.getActivity(); act.runOnUiThread(new Runnable() { public void run() { DropInRequest dropInRequest = new DropInRequest() .clientToken(param); AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act), new IntentResultListener() { public void onActivityResult (int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT); BraintreePaymentCallback.onPurchaseSuccess( result.getPaymentMethodNonce().getNonce()); } else if (resultCode == Activity.RESULT_CANCELED) { BraintreePaymentCallback.onPurchaseCancel(); } else { Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR); BraintreePaymentCallback.onPurchaseFail(error.toString()); Log.e(error); Log.sendLog(); } } }); } }); Android UI Thread Most Android sample code assumes you are on the Android equivalent of the EDT (UI thread). We are on the Codename One EDT or a Codename One thread in a native interface so it’s best to do something like this unless you need a synchronous call
  • 6. final Activity act = AndroidNativeUtil.getActivity(); act.runOnUiThread(new Runnable() { public void run() { DropInRequest dropInRequest = new DropInRequest() .clientToken(param); AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act), new IntentResultListener() { public void onActivityResult (int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT); BraintreePaymentCallback.onPurchaseSuccess( result.getPaymentMethodNonce().getNonce()); } else if (resultCode == Activity.RESULT_CANCELED) { BraintreePaymentCallback.onPurchaseCancel(); } else { Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR); BraintreePaymentCallback.onPurchaseFail(error.toString()); Log.e(error); Log.sendLog(); } } }); } }); Android startActivityForResult This is a very common method of activity but grabbing the result isn’t intuitive which is why we have this method
  • 7. final Activity act = AndroidNativeUtil.getActivity(); act.runOnUiThread(new Runnable() { public void run() { DropInRequest dropInRequest = new DropInRequest() .clientToken(param); AndroidNativeUtil.startActivityForResult(dropInRequest.getIntent(act), new IntentResultListener() { public void onActivityResult (int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { DropInResult result = data.getParcelableExtra(DropInResult.EXTRA_DROP_IN_RESULT); BraintreePaymentCallback.onPurchaseSuccess( result.getPaymentMethodNonce().getNonce()); } else if (resultCode == Activity.RESULT_CANCELED) { BraintreePaymentCallback.onPurchaseCancel(); } else { Exception error = (Exception)data.getSerializableExtra(DropInActivity.EXTRA_ERROR); BraintreePaymentCallback.onPurchaseFail(error.toString()); Log.e(error); Log.sendLog(); } } }); } }); Android Callbacks & API On Android we can access the Codename One API directly since it’s all just Java…
  • 8. dispatch_async(dispatch_get_main_queue(), ^{ BTDropInRequest *request = [[BTDropInRequest alloc] init]; BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError * _Nullable error) { if (error != nil) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription])); } else if (result.cancelled) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE _ARG); } else { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET _STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce)); } [controller dismissViewControllerAnimated:YES completion:nil]; }]; [[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES completion:nil]; }); iOS
  • 9. dispatch_async(dispatch_get_main_queue(), ^{ BTDropInRequest *request = [[BTDropInRequest alloc] init]; BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError * _Nullable error) { if (error != nil) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription])); } else if (result.cancelled) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE _ARG); } else { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET _STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce)); } [controller dismissViewControllerAnimated:YES completion:nil]; }]; [[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES completion:nil]; }); iOS iOS EDT iOS is very sensitive to EDT violations. It’s really important to use it’s main queue (native EDT) for everything related to UI
  • 10. dispatch_async(dispatch_get_main_queue(), ^{ BTDropInRequest *request = [[BTDropInRequest alloc] init]; BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError * _Nullable error) { if (error != nil) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription])); } else if (result.cancelled) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE _ARG); } else { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET _STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce)); } [controller dismissViewControllerAnimated:YES completion:nil]; }]; [[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES completion:nil]; }); iOS Self Self is the Objective-C equivalent of this. In the original code self was used as it was assumed to be a Controller (commonly used iOS abstraction) when you need a controller you can use this syntax
  • 11. dispatch_async(dispatch_get_main_queue(), ^{ BTDropInRequest *request = [[BTDropInRequest alloc] init]; BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:param request:request handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError * _Nullable error) { if (error != nil) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseFail___java_lang_String(CN1_THREAD_GET_ST ATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG [error localizedDescription])); } else if (result.cancelled) { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseCancel__(CN1_THREAD_GET_STATE_PASS_SINGLE _ARG); } else { com_myrestaurant_app_payment_BraintreePaymentCallback_onPurchaseSuccess___java_lang_String(CN1_THREAD_GET _STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG result.paymentMethod.nonce)); } [controller dismissViewControllerAnimated:YES completion:nil]; }]; [[CodenameOne_GLViewController instance] presentViewController:dropIn animated:YES completion:nil]; }); iOS Callbacks Callbacks to Java code are complex and have a slightly different syntax when calling to a no-args method but IDE completion should help…
  • 12. What did we learn? ✦Native interfaces aren’t trivial, but are doable when we overcome the pitfalls and use Google aggressively ✦Error logs on Android are painful and we need to develop reading skill to go thru them ✦Use native IDE’s to develop the native code and shorten the back and forth cycles