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. **********HOUSE DESIGNS************

**********HOUSE DESIGNS************


CLICK HERE <http://www,interiordesignmodels.blogspot.com>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. ***********ACTORS MASALA************

***********ACTORS MASALA************


CLICK HERE <http://www.fireandhotmasala.blogspot.com>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. how to get camera object for double camera

4. Problem with customer view

5. the android's built in video player, supports which file format

6. WiMax via USB?

7. limit screen size of an application ..