cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to get Android SDK Examples to work

Hello,

We are an Authorize.net client, and are trying to add the payment processing functionality to our in-house Android app.

I am trying to get the Android Example code to work with a version 2.3.3 (API 10) Project with the minimum required SDK of 2.2(API 8). I am following the directions on this site under Integration -> Quick Start Guide -> Android, but am getting an error because the SDK download (anet-java-sdk-android-2.0.5.jar) does not have "net.authorize.android" within it, so the statements "package net.authorize;" and the 4 statements "import net.authorize.android.AuthNet;" are giving a "cannot be resolved" error in the ExampleActivity.java file that I am instructed to create.

I have also tried using the Example code (from "anet_android_samples") by creating a new project from existing source code, and am adding "anet-java-sdk-android-2.0.5.jar" to the build path as instructed, but all the src files in the example code (net.authorize.android.*) comes up as unresolved, because they are not in the "anet-java-sdk-android-2.0.5.jar" file.

I am a fairly experienced Java programmer, but I am pretty new to the quirks of Android and Eclipse, so please bear with my naivete. If anyone could help me get this setup so that I can start using the Examples, that would be much appreciated.

Thank you.
begreen
Member
4 REPLIES 4

Hi,

 

Try placing anet-java-sdk-android-2.0.5.jar from the "lib" folder, into a new folder called "libs". This is in accordance with the new Android guidelines of putting external libraries in the /libs folder of the project directory.

 

That should make the imports resolve!

spencer
Member

And to clarify, when you put an external library in the /libs folder, it is no longer necessary to add it as a dependency through Eclipse - the Android plugin will do this automatically. 

I am also facing the same issue, even after placing the jar in libs folder

Hi,

  If the problem is resolved for you. please let me know how you did that

Mounica1131
Member