Can't figure out this compile error

by Tobiah » Sat, 15 Jan 2011 01:58:38 GMT


Sponsored Links
 Trying to launch an IntentService:


package com.rcsreg.exposmart;
import android.app.IntentService;
import android.util.Log;
import android.content.Intent;

public class Sync extends IntentService{

        Integer counter = 0;

        public void Sync(){
                super("Sync");
        }

        @Override
        protected void onHandleIntent(Intent intent){
                while(1 == 1){
                        Log.e("INTENT!!!!", String.format("COUNT IS %d", 
counter++));
                        try{
                                Thread.sleep(3000);
                        } catch (Exception e){
                        }
                }
        }
}


Compiler says:

[javac] Compiling 2 source files to /home/toby/android/exposmart/bin/classes
    [javac] /home/toby/android/exposmart/src/com/rcsreg/exposmart/Sync.java:6: 
cannot find symbol
    [javac] symbol  : constructor IntentService()
    [javac] location: class android.app.IntentService
    [javac] public class Sync extends IntentService{
    [javac]        ^
    [javac] /home/toby/android/exposmart/src/com/rcsreg/exposmart/Sync.java:11: 
call to super must be first statement in constructor
    [javac]             super("Sync");
    [javac]                  ^
    [javac] 2 errors

Thanks,


Tobiah

--



Re: Can't figure out this compile error

by Hari Edo » Sat, 15 Jan 2011 03:28:17 GMT


 > public class Sync extends IntentService
--->   Integer counter;
--->               counter = 0;
...

-- 


Sponsored Links


Re: Re: Can't figure out this compile error

by Tobiah » Sat, 15 Jan 2011 03:50:31 GMT


 

public class Sync extends IntentService {
---> Integer counter;
public void Sync() { super("Sync");
---> counter = 0;
}
...
}
It turned out that I needed to axe the 'void' in the constructor. Thanks --



Other Threads

1. Provide a database packaged with the .APK file or host it separately on a website?

Here is some background about my app:

I am developing an Android app that will display a random quote or
verse to the user. For this I am using an SQLite database. The size of
the DB would be approximately 5K to 10K records, possibly increasing
to upto 1M in later versions as new quotes and verses are added. Thus
the user would need to update the DB as and when newer versions are of
the app or DB are released.

After reading through some forums online, there seem to be two
feasible ways I could provide the DB:
1.  Bundle it along with the .APK file of the app, or
2.  Upload it to my app's website from where users will have to
download it

I want to know which method would be better (if there is yet another
approach other than these, please do let me know).

After pondering this problem for some time, I have these thoughts
regarding the above approaches:

Approach 1:
Users will obtain the DB along with the app, and won't have to
download it separately. Installation would thereby be easier. But,
users will have to reinstall the app every time there is a new version
of the DB. Also, if the DB is large, it will make the installable too
cumbersome.

Approach 2:
Users will have to download the full DB from the website (although I
can provide a small, sample version of the DB via Approach 1). But,
the installer will be simpler and smaller in size. Also, I would be
able to provide future versions of the DB easily for those who might
not want newer versions of the app.

Could you please tell me from a technical and an administrative
standpoint which approach would be the better one and why?

If there is a third or fourth approach better than either of these,
please let me know.

Thank you!

Pankaj Godbole
Andruid

--~--~---------~--~----~------------~-------~--~----~

2. Put some image on background of a row of a ListView

ListView Question !

I know it's possible change the row color, but it's possible to put some
imagem on background?
And if yes, it's possible to create an imagem 1px and repeat-x or repeat-y
like CSS?

-- 
[]'s
Gustavo Melo

--~--~---------~--~----~------------~-------~--~----~

3. Does Android Power Management need to use ACPI function?

4. How to launch activity act2.class (contained in project2.apk) from activity1 in project1.apk ?

5. SoftKeyboard - detecting pressed key

6. Choosing a reliable Web Hosting company

7. Android 2.0 Google Maps Navigation and app use of turn-by-turn directions?