April 2015
Beginner to intermediate
494 pages
10h 26m
English
Let's define a Java interface that native C/C++ code will call back through JNI:
StoreListener.java, which contains an interface defining a few callbacks, one for integers, one for strings, and one for colors, as follows:package com.packtpub.store;
public interface StoreListener {
void onSuccess(int pValue);
void onSuccess(String pValue);
void onSuccess(Color pValue);
}Store.java and make a few changes.StoreListener, to which success callbacks are sentStore constructor to inject the delegate listener, which is going to be StoreActivityPublic class Store implements StoreListener { private StoreListener mListener; public Store(StoreListener pListener) ...
Read now
Unlock full access