Should be able to launch an Activity from the browser (not a WebView)

by Fred Grott(shareme) » Sun, 04 Jan 2009 05:28:02 GMT


Sponsored Links
 There is not an obvious  way..iPhone has the same problem.

In the PhoneGap js lib project  tackled it by doing a native class to
enable the 'intent' and use the javascript bridge to access it and
call it..

The other project more specific to Android is the OpneIntents project
at googlecode..









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



Other Threads

1. Android HttpPost and HttpGet

Hi all,

Android: 2.1 SDK

I have a hello.php running on standard Linux host. (Ubuntu 9.01 with
Apache2 web server)

In android I have a simple activity which sends HttpPost or HttpGet to
the above hello.php with some parameters in URL.
Irrespective of HttpPost or HttpGet in my php always $_GET has values,
$_POST is always empty.

How do I know in PHP if it was a post , get,put or a delete?
$_REQUEST['REQUEST_METHOD'] is also always empty in my php.

Appreciate any input.

Thanks and Regards,
Krt

-- 

2. Weird cursorIndexOutOfBoundsException

I am getting a Weird cursorIndexOutOfBoundsException
The logcat:
11-12 13:17:01.545: ERROR/AndroidRuntime(329): FATAL EXCEPTION: main
11-12 13:17:01.545: ERROR/AndroidRuntime(329):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.gremlingames.rimblade/
com.gremlingames.rimblade.LevelSelectionActivity}:
android.database.CursorIndexOutOfBoundsException: Index -1 requested,
with a size of 1
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2663)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.os.Handler.dispatchMessage(Handler.java:99)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.os.Looper.loop(Looper.java:123)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
java.lang.reflect.Method.invoke(Method.java:521)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
dalvik.system.NativeStart.main(Native Method)
11-12 13:17:01.545: ERROR/AndroidRuntime(329): Caused by:
android.database.CursorIndexOutOfBoundsException: Index -1 requested,
with a size of 1
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:
214)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java:
84)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
com.gremlingames.rimblade.LevelSelectionActivity.onCreate(LevelSelectionActivity.java:
52)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
11-12 13:17:01.545: ERROR/AndroidRuntime(329):     ... 11 more

The relevant code snippet:
RimbladeDatabaseOpenHelper dataBaseOpener = new
RimbladeDatabaseOpenHelper(
                                (Context) getApplication());
                SQLiteDatabase rimbladeDatabase =
dataBaseOpener.getReadableDatabase();
                Cursor levelCursor = rimbladeDatabase.rawQuery("SELECT "
                                + RimbladeDatabaseOpenHelper.LEVEL_COL_NAME + " 
as _id, "
                                + RimbladeDatabaseOpenHelper.SCORE_COL_NAME + " 
FROM "
                                + RimbladeDatabaseOpenHelper.SCORE_TABLE_NAME, 
null);

                int totalScore = 0;
                int scoreIndex = levelCursor
                                
.getColumnIndex(RimbladeDatabaseOpenHelper.SCORE_COL_NAME);
                while (!levelCursor.isAfterLast()) {
                        totalScore += levelCursor.getInt(scoreIndex);
                }
The RimbladeDatabaseOpenHelper:
public class RimbladeDatabaseOpenHelper extends SQLiteOpenHelper {

        private static final int DATABASE_VERSION = 1;
    public static final String SCORE_TABLE_NAME = "scores";
    public static final String LEVEL_COL_NAME = "level";
    public static final String SCORE_COL_NAME = "score";
    private static final String SCORE_TABLE_CREATE =
                "CREATE TABLE " + SCORE_TABLE_NAME + " (" +
                LEVEL_COL_NAME + " TEXT NOT NULL, " +
                SCORE_COL_NAME + " INT NOT NULL);";



        public RimbladeDatabaseOpenHelper(Context context) {
                super(context, "rimblade", null, DATABASE_VERSION);
        }

        public void onCreate(SQLiteDatabase db) {
                db.execSQL(SCORE_TABLE_CREATE);
                android.content.ContentValues values = new
android.content.ContentValues();
                values.put(LEVEL_COL_NAME, "start");
                values.put(SCORE_COL_NAME, 0);
                db.insert(SCORE_TABLE_NAME, SCORE_COL_NAME, values);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {

        }

}

-- 

3. Can not start the Email?

4. How to arrange the primary key in ascending order

5. OOT : Ngobrol santai di Springhill pkl. 19:00 Wib

6. HTC EVO as a Dev Phone in non 4g Country

7. 5,000 5 star ratings for Radar Now!