+ Start a Discussion
HaxacoHaxaco 

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

Best Answer chosen by Admin (Salesforce Developers) 
forecast_is_cloudyforecast_is_cloudy

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

forecast_is_cloudyforecast_is_cloudy

Did you download the Android Mobile SDK from this location - http://media.developerforce.com/workbooks/temp/AndroidSDK.zip? 

HaxacoHaxaco

forecast_is_cloudy wrote:

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?

forecast_is_cloudyforecast_is_cloudy

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.

This was selected as the best answer
Richard SchillingRichard Schilling

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);

    }

 

}

 

 

HaxacoHaxaco

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

jhandaljhandal

How  you did It?

 

I tried all the lst downloads :mansurprised:

 



Description	Resource	Path	Location	Type
OAuthToken cannot be resolved to a type	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 33	Java Problem
OAuthToken cannot be resolved to a type	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 61	Java Problem
OAuthToken cannot be resolved to a type	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 104	Java Problem
OAuthToken cannot be resolved to a type	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 105	Java Problem
OAuthToken cannot be resolved to a type	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 113	Java Problem
OAuthToken cannot be resolved to a type	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 26	Java Problem
OAuthToken cannot be resolved to a type	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 36	Java Problem
OAuthToken cannot be resolved to a type	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 49	Java Problem
OAuthToken cannot be resolved to a type	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 50	Java Problem
OAuthToken cannot be resolved to a type	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 58	Java Problem
The import com.salesforce.android cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 19	Java Problem
The import com.salesforce.android cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 20	Java Problem
The import com.salesforce.android cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 21	Java Problem
The import com.salesforce.android cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 22	Java Problem
The import com.salesforce.android cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 23	Java Problem
The import com.salesforce.android cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 14	Java Problem
The import com.salesforce.android cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 15	Java Problem
The import com.salesforce.android cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 16	Java Problem
The import com.salesforce.sdk cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 24	Java Problem
The import com.salesforce.sdk cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 25	Java Problem
The import com.salesforce.sdk cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 26	Java Problem
The import com.salesforce.sdk cannot be resolved	AlbumListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 27	Java Problem
The import com.salesforce.sdk cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 17	Java Problem
The import com.salesforce.sdk cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 18	Java Problem
The import com.salesforce.sdk cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 19	Java Problem
The import com.salesforce.sdk cannot be resolved	TrackListActivity.java	/CloudTunes/src/com/salesforce/androidsdk/sample	line 20	Java Problem

 

jhandaljhandal

 Hi

 

Salesforce is a Android Library then I included as a jar library in CloudeTunes .

 

Great code!