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. Mirink android bandung di usir di green cafe.....

mirink android bandung di usir di green cafe..... KECEWA....
klo mau ada mirink di wilayah bandung jgn di green cafe nanti bisa2 di
usir.....

-- 
"Indonesian Android Community [id-android]" 

2. Drawing 2D stuff on the screen in OpenGL over a 3D scene

Can somebody take me step-by-step how to draw 2D stuff over a 3D scene
(such as controls, etc.). What I've been doing so far has not been
working (it only draws the 3D scene), which is (in every frame): draw
the 3D scene as normal, projection matrix mode, load identity, call
GLU.gluOrtho2D(gl, 0, myScreenWidthInPixels, 0,
myScreenHeightInPixels), switch the array pointers (vertices and
texture coords) to the ones for my 2D stuff, then drawElements with an
appropriate index list. (then switch the array pointers back so the 3D
stuff works again).

I get nothing added to the screen (just the 3D stuff).

Do I need to be doing something else for it to draw? Can somebody take
me step-by-step?

-- 

3. Looking for programmer - iMagnifier.com

4. WC 2010 lagi masalah

5. CHANGE_WIFI_MULTICAST_STATE

6. Local TCP/IP server

7. kenapa tampilan keyboard?