Issue in openintents simulator, after running directly going to "Connection settings" page instead of my desired page

by Nithin » Wed, 04 Mar 2009 15:27:27 GMT


Sponsored Links
 hi,

I am trying to use open intents simulator and do all the settings
according to the instructions. But when i tried to run a sample
program, after running, its directly going to the "connections
settings page" in openintents.apk.

please guide me in this issue, heres my code...

import org.openintents.hardware.SensorManagerSimulator;
import org.openintents.provider.Hardware;

import android.app.Activity;
import android.content.Intent;
import android.hardware.SensorListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.widget.Toast;

public class OpenPage extends Activity implements SensorListener {

        SensorManager sensorManager;
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.openpage);

                /* start open intents code */

                Hardware.mContentResolver = getContentResolver();
                sensorManager = (SensorManager)getSystemService
(SENSOR_SERVICE);
                Intent intent = new Intent(Intent.ACTION_VIEW,
Hardware.Preferences.CONTENT_URI);
                startActivity(intent);
                sensorManager.unregisterListener(this);
                SensorManagerSimulator.connectSimulator();

                /*end open intents code */

                sensorManager.registerListener(this,
SensorManager.SENSOR_ACCELEROMETER |
                           SensorManager.SENSOR_MAGNETIC_FIELD |
                           SensorManager.SENSOR_ORIENTATION,
                           SensorManager.SENSOR_DELAY_FASTEST);
        }

        @Override
    protected void onResume() {
        super.onResume();
        sensorManager.registerListener(this,
                SensorManager.SENSOR_ACCELEROMETER |
                SensorManager.SENSOR_MAGNETIC_FIELD |
                SensorManager.SENSOR_ORIENTATION,
                SensorManager.SENSOR_DELAY_FASTEST);
    }

    @Override
    protected void onStop() {
        sensorManager.unregisterListener(this);
        super.onStop();
    }

        public void onAccuracyChanged(int sensor, int accuracy) {
        }

        public void onSensorChanged(int sensor, float[] values) {
                Toast.makeText(this, Float.toString(values[0]) +"::"+
Float.toString
(values[1]) +"::"+ Float.toString(values[2]), Toast.LENGTH_SHORT).show
();
        }

}

Thanks
Nithin
--~--~---------~--~----~------------~-------~--~----~



Issue in openintents simulator, after running directly going to "Connection settings" page instead of my desired page

by (Mishail) » Wed, 04 Mar 2009 23:50:13 GMT


 It's OK since your activity starts OpenIntents by startActivity
(intent);

Your activity should resume after exiting from openintents. But please
make sure that you granted "android.permission.INTERNET"  for your
application, see  http://code.google.com/p/openintents/wiki/SensorSimulator ,
comments section, "Comment by patrickneese,  Feb 03, 2009":
There shall be <uses-permission
android:name="android.permission.INTERNET"/> for your activity




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


Sponsored Links


Issue in openintents simulator, after running directly going to "Connection settings" page instead of my desired page

by nithin » Thu, 05 Mar 2009 12:15:53 GMT


 Thanks Mishail,

i hope that will help.. going to try..

Nithin




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



Other Threads

1. InvocationException occurred invoking method. "no such column:"database question

Hello,  a bit more data on the problem of "_id" column not existing,
a post that I had made earlier.
Inside of my query in a ContentProvider I attempt to read the
database. The error points back to the "_id" no such column.  I don't
get it?  I have tried upper case and lowercase "_id" name.  the column
is there as you can see in the Log output.

I am still working on it but??
thanks

Jeff

public void onCreate(SQLiteDatabase db) {
            db.execSQL("CREATE TABLE " + MEDS_TABLE_NAME + " ("
             + Meds._ID + " INTEGER PRIMARY KEY autoincrement,"
             + Meds.sMEDS_FK + " INTEGER ,"
             + Meds.sSTATUS + " TEXT,"
             + Meds.sSOURCE + " TEXT,"
             + Meds.sPRODUCT + " TEXT,"
             + Meds.sDIRECTIONS + " TEXT,"
             + Meds.sFULLFILLHISTORY + " TEXT,"
             + Meds.sCREATION_DATE + " TEXT,"
             + Meds.sMODIFIED_DATE + " TEXT"
                                       + ");");
            Log.w(TAG, "onCreate");
        }

<b>Insert is working:</b>

long rowId = db.insert(MEDS_TABLE_NAME, Meds.MED, values);
        Log.e(TAG, "aft insert  rowId = " + rowId);
LOG --11-21 08:32:30.983: ERROR/MPhrProvider(195): aft insert  rowId =
10

    if (rowId > 0) {
            Uri medUri = ContentUris.withAppendedId
(MPhrDef.Meds.CONTENT_URI, rowId); // append rowid at end of givin uri

            getContext().getContentResolver().notifyChange(medUri,
null);
            return medUri;

  SQLiteDatabase db = mOpenHelper.getReadableDatabase();
        Cursor c = qb.query(db, projection, selection, selectionArgs,
null, null, null);
        Log.e(TAG, "OnCreate cursor.getColumnName0 = " +
c.getColumnName(0));
        Log.e(TAG, "OnCreate cursor.getColumnName1 = " +
c.getColumnName(1));
       11-21 09:10:19.120: ERROR/MPhrProvider(195): OnCreate
cursor.getColumnName0 = _ID

11-21 09:10:23.240: ERROR/MPhrProvider(195): OnCreate
cursor.getColumnName1 = SOURCE



detailMessage   "Invalid column _ID"

--------------
Here I changed the case of _ID to _id (lower)
Cursor c = qb.query(db, projection, selection, selectionArgs, null,
null, null);
        Log.e(TAG, "OnCreate cursor.getColumnName0 = " +
c.getColumnName(0));
        Log.e(TAG, "OnCreate cursor.getColumnName1 = " +
c.getColumnName(1));

LOGCAT

[0]     "_id"
[1]     "SOURCE"

String[] p = {"_id", "SOURCE", "PRODUCT"};
        String st = qb.buildQuery(p, selection, selectionArgs, null,
null, orderBy, null);
        Cursor cc =db.rawQuery(st, null);
11-21 09:28:57.376: ERROR/MPhrProvider(194): OnCreate
cursor.getColumnName0 = _ID

11-21 09:29:12.129: ERROR/MPhrProvider(194): OnCreate
cursor.getColumnName1 = SOURCE



com.sun.jdi.InvocationException occurred invoking method.

Unable to start activity ComponentInfo{com.csi.android.mPHR/
com.csi.android.mPHR.MPhrList}:
android.database.sqlite.SQLiteException: no such column: modified: ,
while compiling: SELECT _id, SOURCE, PRODUCT FROM medsTbl ORDER BY
modified DESC
Detail formatter error:
                An exception occurred: android.database.sqlite.SQLiteException

java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.csi.android.mPHR/com.csi.android.mPHR.MPhrList}:
android.database.sqlite.SQLiteException: no such column: modified: ,
while compiling: SELECT _id, SOURCE, PRODUCT FROM medsTbl ORDER BY
modified DESC
--~--~---------~--~----~------------~-------~--~----~

2. use dependencies

Anyone knows how to use dependencies in Android.

I need to

import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.FileBody;

but I don't know how import classes that are not in Android.

thank's


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

3. does the emulator support any coonetction method to smart card?

4. Emulator crash

5. Unable to download any applications from the Marketplace

6. Disappearing Dialer

7. REPOST: ListView selection highlight size