You need to sign in to do that
Don't have an account?
Haxaco
Android Salesforce SDK errors
Following the mobile workbook I went the Android route: I did the SDFCRestSample app but I wanted to do the CloudTunes one and the SalesforceSDK package that you need to use comes with 3 errors in OAuthActivity.java
- The method onAuthCancelled(boolean) of type OAuthActivity must override a superclass method
- The method onAuthError(Uri, String, String, boolean) of type OAuthActivity must override a superclass method
- The method onAuthSuccess(OAuthToken, boolean) of type OAuthActivity must override a superclass method
Removing the @override does clear them but then the CloudTunes apk crashes when loading into the emulator/device
Help? Ideas?
Also on the workbook it says that the salesforceSDK is available in a jar file but I have not been able to find it at all.
I rather use the salesforceSDK than creating my own library if possible
I think your issue might be related to your specific dev. environment and not the SDK. Basically, the OAuthActivity.java class implements the com.salesforce.android.sdk.view.OAuthListener interface. The ability to annotate overriden interface methods as '@Override' was added in Java 1.6. In Java 1.5 and earlier it was only possible to use that annotation with an overriden class method. Looks like your dev. env. is using a 1.5 compiler.
In Eclipse, can you check if Project Properties ->Java Compiler -> Check “Enable Project Specific Settings” -> “Compiler Compliance Level” is set to 6 or higher? Also, make sure that your Eclipse is using a >=1.6 runtime.
All Answers
Did you download the Android Mobile SDK from this location - http://media.developerforce.com/workbooks/temp/AndroidSDK.zip?
Definitely did, did it work on your system? I tried it in two places, both at my work laptop and my home pc and it sitll showed the same errors on Eclipse 3.6 and Java 6 with the Android SDK. Could I possibly get a jar and test it out?
I think your issue might be related to your specific dev. environment and not the SDK. Basically, the OAuthActivity.java class implements the com.salesforce.android.sdk.view.OAuthListener interface. The ability to annotate overriden interface methods as '@Override' was added in Java 1.6. In Java 1.5 and earlier it was only possible to use that annotation with an overriden class method. Looks like your dev. env. is using a 1.5 compiler.
In Eclipse, can you check if Project Properties ->Java Compiler -> Check “Enable Project Specific Settings” -> “Compiler Compliance Level” is set to 6 or higher? Also, make sure that your Eclipse is using a >=1.6 runtime.
Haxaco,
It's nice to know you'd like to use our library. :-)
We're here to help!
To answer your question - the errors you're seeing shouldn't be because of an error in the SDK. I just synched up with the latest version of the SDK code and was unsuccessful in re-producing the errors you mention.
If you're working directly with the source code you don't need the .jar file ... you can just link to the directory that contains the library source code in your Eclipse project.
I can't see your code, but I am guessing that you're trying to extend OAuthActivity with something like the following. Is that correct ?
public class MyActivity extends OAuthActivity {
@Override
public void onAuthError(Uri uri, String error, String description,
boolean finish) {
// TODO Auto-generated method stub
super.onAuthError(uri, error, description, finish);
}
@Override
public void onAuthSuccess(OAuthToken token, boolean finish) {
// TODO Auto-generated method stub
super.onAuthSuccess(token, finish);
}
@Override
public void onAuthCancelled(boolean finish) {
// TODO Auto-generated method stub
super.onAuthCancelled(finish);
}
}
Thanks guys I got it working. It was a combination of the SalesforceSDK not using Java 1.6 and the latest and greatest Android SDK. I started clean with that and it happily ran the CloudTunes apk. Thanks for all your help and for providing an SDK
How you did It?
I tried all the lst downloads :mansurprised:
Hi
Salesforce is a Android Library then I included as a jar library in CloudeTunes .
Great code!