Is five-way navigation key a mandatory requirement?

by JC » Thu, 25 Jun 2009 01:46:01 GMT


Sponsored Links
 Dear sir,

I learnt that there is a "recommended" minimum device requirements for
Android device, however if I want to develop a device without five-way
navigation key, is this allowed?

BR,
JC

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



Other Threads

1. Can't create MediaPlayer from sound resource in res/raw

Hello,

I am getting a resource not found exception when I attempt to create a
MediaPlayer via MediaPlayer.create.
The full text of the exception is "android.content.res.Resources
$NotFoundException:File res/raw/dice_land.ogg from drawable resource
ID #7f030000"

I have done a google search and found that a few others have had the
same problem, but solutions are scarce.

Here is what I have verified:
*The sound file is in the res/raw folder, and is named correctly.
*The build system is finding it, because it is correctly generating a
resource ID for it in R.java.
*The apk file, when opened as a ZIP file, contains the res/raw
directory and that directory contains my dice_land.ogg sound file.
*That sound file plays in my media player on my desktop pc and (when I
put it on my SD card) plays using the music player app on my phone, so
the file is not corrupt.
*Other than the sound, the application runs fine, and other resources
like the button and the main LinearLayout and the applicaiton name are
getting loaded with no trouble.
*It does not matter if the file is .ogg, .wav, or .mp3.  I have tried
all 3, and always get identical exception (with the file extension
different, obviously)
I have tried creating the MediaPlayer in the onCreate method, and in a
button OnClickListener (the current version).  Identical results.

I am building in debug mode, so the keystore is the default.keystore
from the android sdk.
I am using android_sdk_r05 tools.  I am running NetBeans 6.8 with the
android development plugin NBAndroid v 1.0.
The target platform is the MyTouch 3g running the factory
configuration, which is Android 1.6.


I have zipped up my NetBeans project in its entirety, and put it in
google docs.  You all can access it here:
https://docs.google.com/leaf?id=0B72czU3VsdcaOGNmZDBlMjktMGZkMS00OTc4LThhNTQtMDJjMzM2YjUwMGI4&hl=en

For those not inclined to that much detail, here is the source code:

package com.europasw.soundcheck;

import android.app.Activity;
import android.app.AlertDialog;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SoundCheck extends Activity {
    MediaPlayer mp = null;

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        this.setContentView(R.layout.main);
        Button rollButton = (Button)
this.findViewById(R.id.rollButton);
        rollButton.setOnClickListener(rollButtonClicked);
    }

    OnClickListener rollButtonClicked = new OnClickListener()
    {
        public void onClick(View v)
        {
            try
            {
                if (mp == null)
                {
                    mp = MediaPlayer.create(v.getContext(),
R.raw.dice_land);
                }

                if (mp != null)
                {
                    mp.reset();
                    mp.prepare();
                    mp.start();
                }
                else
                {
                    MessageBox("Couldn't create MediaPlayer");
                }
            }
            catch (Exception x)
            {
                // I always end up here.
                MessageBox("Exception: " + x);
            }
        }

    };

    @Override
    public void onDestroy()
    {
        if (mp != null)
        {
            mp.release();
        }

        super.onDestroy();
    }

    void MessageBox(String msg)
    {
        AlertDialog.Builder builder =
                new AlertDialog.Builder(this);
        builder.setMessage(msg);
        builder.setPositiveButton("OK", null);
        AlertDialog d = builder.show();
    }

}

And here is the contents of R.java:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package com.europasw.soundcheck;

public final class R {
    public static final class attr {
    }
    public static final class id {
        public static final int rollButton=0x7f050000;
    }
    public static final class layout {
        public static final int main=0x7f020000;
    }
    public static final class raw {
        public static final int dice_land=0x7f030000;
    }
    public static final class string {
        public static final int app_name=0x7f040000;
    }
}

Thanks for your time.  Any help would be greatly appreciated.

-- 

2. Content provider / ListView - Close the database but leave the cursor open?

I have a ContentProvider that stores data in a SQLite database. I also
have an app with a ListView that displays data queried from the
ContentProvider. I run a query() on the ContentProvider, then I take
the returned Cursor, make an adaptor, and set it to the ListView, like
so:

                dbAdapter = getContentResolver();
                deviceList = (ListView)this.findViewById(R.id.deviceList);

                Cursor allDevices =
                        dbAdapter.query(BluetoothContentProvider.CONTENT_URI,
                                                        
BluetoothContentProvider.ALL_COLUMNS,
                                                        null,
                                                        null,
                                                        
BluetoothContentProvider.KEY_ROWID + " ASC");
                startManagingCursor(allDevices);
                SimpleCursorAdapter cursorAdaptor =
                        new SimpleCursorAdapter(this, R.layout.device, 
allDevices,
COLUMN_HEADINGS, DISPLAY_FIELDS);
                deviceList.setAdapter(cursorAdaptor);


If I close the database inside the query() of the Provider, I get an
"Invalid statement in fillWindow()" error from the returned Cursor,
but I don't want to leave the database permanently open either. What
should I do?

-- 

3. How to reverse android.graphics.Path

4. How to click multiple buttons through sliding motion

5. Youtube, Gmail, Google Maps

6. List all groups for an account

7. Using living infornmation in an application