Search code examples
androidibm-mobilefirst

Android native api not working


I have a project that is implemented for native Android and is integrated with Worklight server adapters.

The problem is I'm trying to integrate the Worklight Android native API in the project; I created a native API locally deployed it on the server then modified the .properties file, but I couldn't connect the server in any way.

UNEXPECTED_ERROR Unexpected errorCode occurred. Please try again.


Solution

  • When attempting to use your provided project there were many Gradle errors I could not overcome. Instead I have:

    1. Followed these instructions to create a new Android project and add the MFP SDK to it: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/hello-world/creating-first-native-android-mobilefirst-application/

    2. Added the code snippets provided here: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-native-android-development-7-0/quick-start-demonstration/

    I was able to connect to the server, invoke the adapter and see the result in the Android Studio log.

    Should be noted that in your project, you are missing the bcprov.jar file in the libs folders as well.