Teaching Android

by Sabin » Tue, 30 Sep 2008 11:17:09 GMT


Sponsored Links
 Hi,

I plan to teach android to my MSc Mobile Computing class. I wonder if
I can get in touch directly with someone from the Android team about
this matter.

Regards,

Sabin

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



Other Threads

1. avcrp & motorola ht820

i am trying to catch the physical button events on a motorola ht820
bluetooth headset and it i cannot seem to trap those events.

the media player on the device *is* able to catch those events.

based, on what I've read and googled for, it seems like this should do
the trick --

                rec = new BroadcastReceiver() {
                        @Override
                        public void onReceive(Context context, Intent intent) {
                    KeyEvent event = (KeyEvent) intent.getParcelableExtra
(Intent.EXTRA_KEY_EVENT);
                    if (event != null && event.getAction() ==
KeyEvent.ACTION_DOWN) {
                        switch (event.getKeyCode()) {
                        case KeyEvent.KEYCODE_HEADSETHOOK:
                        case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
                                                getInstance().playpause();
                            abortBroadcast();
                                break;
                        case KeyEvent.KEYCODE_MEDIA_STOP:
                                getInstance().stop(true);
                                abortBroadcast();
                                break;
                        case KeyEvent.KEYCODE_MEDIA_NEXT:
                                getInstance().next();
                                abortBroadcast();
                                break;
                        case KeyEvent.KEYCODE_VOLUME_UP:
                                AudioManager audioMgrUp = (AudioManager)
getSystemService(Context.AUDIO_SERVICE);
                                audioMgrUp.adjustStreamVolume(
                                        AudioManager.STREAM_MUSIC, 
AudioManager.ADJUST_RAISE,
AudioManager.FLAG_SHOW_UI);
                                break;
                        case KeyEvent.KEYCODE_VOLUME_DOWN:
                                AudioManager audioMgrDown = (AudioManager)
getSystemService(Context.AUDIO_SERVICE);
                                audioMgrDown.adjustStreamVolume(
                                                AudioManager.STREAM_MUSIC, 
AudioManager.ADJUST_LOWER,
AudioManager.FLAG_SHOW_UI);
                                break;
                        }
                    }
                        }
                };

        // Use a separate receiver for ACTION_MEDIA_BUTTON broadcasts,
        // since we need to manually adjust its priority (to make sure
        // we get these intents *before* the media player.)
        IntentFilter intentFilter = new IntentFilter(
                Intent.ACTION_MEDIA_BUTTON);

but it does not seem to work.

Here's what I'm seeing in the logcat.

any ideas?  tia.

01-25 07:39:53.338: WARN/AudioFlinger(45): write blocked for 54 msecs
01-25 07:39:53.388: ERROR/MediaPlaybackService(652): BadQueue
mPlayListLen : 0 mAlbumListLen : 0 mShrinkAlbumListLen : 0
01-25 07:39:53.398: WARN/AudioFlinger(45): write blocked for 56 msecs
01-25 07:39:53.428: DEBUG/MediaButtonIntentReceiver(652): > onReceive
<
01-25 07:39:53.448: INFO/BluetoothA2dpService.cpp(23187): ACVRCP :
Remote Pannel Pressed with Channel:0
01-25 07:39:53.458: INFO/BluetoothA2dpService.cpp(23187): Panel
Opcode: 0x4c
01-25 07:39:53.498: DEBUG/MediaButtonIntentReceiver(652): > onReceive
<
01-25 07:39:53.508: VERBOSE/MediaPlaybackService(652): onStart
01-25 07:39:53.518: ERROR/MediaPlaybackService(652): MediaMode:Local
01-25 07:39:53.518: DEBUG/MediaPlaybackService(652): CMDPREVIOUS
01-25 07:39:53.558: ERROR/MediaPlaybackService(652): BadQueue
mPlayListLen : 0 mAlbumListLen : 0 mShrinkAlbumListLen : 0
01-25 07:39:53.588: WARN/AudioFlinger(45): write blocked for 146 msecs
01-25 07:39:53.658: INFO/BluetoothA2dpService.cpp(23187): ACVRCP :
Remote Pannel Released with Channel:0
01-25 07:39:53.668: INFO/BluetoothA2dpService.cpp(23187): Panel
Opcode: 0x4c
01-25 07:39:53.698: WARN/AudioFlinger(45): write blocked for 62 msecs
01-25 07:39:53.738: DEBUG/MediaButtonIntentReceiver(652): > onReceive
<
01-25 07:39:53.968: INFO/BluetoothA2dpService.cpp(23187): ACVRCP :
Remote Pannel Pressed with Channel:0
01-25 07:39:53.978: DEBUG/MediaButtonIntentReceiver(652): > onReceive
<
01-25 07:39:53.988: VERBOSE/MediaPlaybackService(652): onStart
01-25 07:39:53.988: ERROR/MediaPlaybackService(652): MediaMode:Local
01-25 07:39:53.988: DEBUG/MediaPlaybackService(652): CMDNEXT
01-25 07:39:53.988: DEBUG/MediaPlaybackService(652): next
mPlayOnNextPrev=true
01-25 07:39:54.028: ERROR/MediaPlaybackService(652): BadQueue
mPlayListLen : 0 mAlbumListLen : 0 mShrinkAlbumListLen : 0

-- 

2. getIntExtra only returns default value

I am trying to pass an integer between activities using an intent.

The source activity makes the calls info.id is the selected item from
a ListView.

                                Intent intent = new Intent(myActivity.this,
newClass.class);
                                intent.putExtra("selectedItem", info.id);
                                this.startActivity(intent);

The target activity retrieves the intent using getIntent then calls
int iSelectedItem = intent.getIntExtra("selectedItem", -1);
iSelectedItem is always -1 instead of the value passed to putExtra.

Can someone tell me what I am doing wrong or do I misunderstand the
use of intents?

--

3. dhcpcd - issue

4. PackageManage: Couldn't copy package file to temp file.

5. Simple Video enhance demo

6. Istilah-istilah

7. Fwd: androidmarket search