How to make a widget that doesn't drain the battery and updates often

by Mark Murphy » Sun, 06 Jun 2010 02:46:29 GMT


Sponsored Links
 


You are missing the point. Unless you have evidence that your alarms go
off on devices other than your own, it may simply be a matter of some
WakeLock being wedged on your own device.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android App Developer Books:  http://commonsware.com/books 

--



Other Threads

1. MediaPlayer -- shoutcast radio streaming creates a lag in playback

Hello, all!

I've been working on an app to stream some radio content. I get the
stream and save it to a file. When there is enough of it to play, I
invoke MediaPlayer and pass in the file.

Here is the question...since MediaPlayer sees only the portion of the
mp3 file that has already been written when MediaPlayer was
instantiated, I have to instantiate multiple MediaPlayers and call the
seekto() method. But the reinstantiation creates a short gap in
playback -- about half a second (have been testing the app in the
emulator, but I'm guessing the same will happen on the actual phone).

I'm sure this has been solved by others -- any suggestions???

Below is the thread that's called from within my Service once the
initial buffering has been done. All this does is repeatedly calling
the play() method that just reprocessing the mp3 file (while another
thread is writing to that mp3 file).

        private final Thread watchRadioPlayer = new Thread() {
                public void run() {
                        while (isDownloading) {
                                curPosition = 
RadioPlayer.play(OnlineRadioRetriever.fileName,
curPosition);
                                int delay = curPosition - previousPosition;
                                previousPosition = curPosition;
                                try {
                                        synchronized (this) {
                                                wait(delay);
                                        }
                                } catch (InterruptedException e) {
                                        Log.e("watchRadioPlayer", "Exception 
while calling wait: ", e);
                                }
                                Log.d("watchRadioPlayer", "RUNNING for : " + 
delay);
                        }
                        Log.d("watchRadioPlayer", "The THREAD is dead");
                }
        };

-- 

2. call for the other apk file

hi guys,

Now, I have two apk in /data/app which are a.apk and b.apk,
and I want to invoke b.apk from a.apk,


so in the a.apk,
I used the Intent object to achive:
========code===========
        Intent intent=new Intent("android.intent.action.MAIN");
        intent.setClassName("com.android.b", "test"); //package name
and class name
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                        Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT );
        startActivity(intent);
        a.this.finish();
=======================
but with error by logcat::

========error============
E/AndroidRuntime(  740): android.content.ActivityNotFoundException:
Unable to fi
nd explicit activity class {com.android.b/test}; have you declared t
his activity in your AndroidManifest.xml?
=======================

so how can I do for that?
thanks!

-- 

3. Regarding the database schema of Android native database

4. Tips gonta ganti Rom

5. tips2 beli htc her

6. Picking up a PhoneBook entry under Android 2.0 !!!

7. Picking up a PhoneBook entry under Android 2.0 !!!