The application camera has stopped error

by Amit Sood » Wed, 21 Jul 2010 03:57:28 GMT


Sponsored Links
 Hello Experts,

I am trying to run my camera on my emulator, but every time i try
running it i get the following error.

the application camera (process com.android.camera) has stopped
unexpectedly. please try again

Please advice

Massive thanks

--



The application camera has stopped error

by tinyang » Wed, 21 Jul 2010 06:20:24 GMT


 First, check your logcat and post the lines generated by the error.
Secondly, what version of android are you running it on when you get this
error, and what are you trying to do with the camera?  The offending code
snippet might be helpful also. 

-----Original Message-----
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Amit Sood
Sent: Tuesday, July 20, 2010 2:57 PM
To: Android Beginners
Subject: [android-beginners] The application camera has stopped error

Hello Experts,

I am trying to run my camera on my emulator, but every time i try running it
i get the following error.

the application camera (process com.android.camera) has stopped
unexpectedly. please try again

Please advice

Massive thanks

--


Sponsored Links


Other Threads

1. do you know how to change skin in android project?

hello,boys and girls,
do you have the experience of change skin in android project?
if you had,please share with me,ok?
thank you.

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

2. Getting mock gps data

Hi All,
I've been struggling with MockLocationProvider for two days and it
doesn't work for me. I'll try to download new sdk. But since it is
downloading now i can express what's not working for me:

Here is my Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="pl.itigo.hw"
      android:versionCode="1"
      android:versionName="1.0">

        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission
android:name="android.permission.ACCESS_MOCK_LOCATION" />
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <uses-library android:name="com.google.android.maps" />
        <activity android:name="pl.itigo.hw.HelloWorld"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="3" />
</manifest>

HelloWorld.java:

public class HelloWorld extends MapActivity {
        LinearLayout linearLayout;
        MapView mapView;
        ZoomControls mZoom;
        MapController mController;
        TextView txView;

        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
                txView = (TextView) findViewById(R.id.txView);
                mapView = (MapView) findViewById(R.id.mapview);
                mZoom = (ZoomControls) mapView.getZoomControls();
                linearLayout = (LinearLayout) findViewById(R.id.zoomview);
                linearLayout.addView(mZoom);
                mController = mapView.getController();

                LocationManager locationManager = (LocationManager) 
getSystemService
(LOCATION_SERVICE);
                PendingIntent pIntent = PendingIntent.getBroadcast(this, 0,
                                new Intent(), 0);
                Log.i("location", "Providers: " + 
locationManager.getAllProviders
());
                // new Thread(new MockGps(locationManager)).start();
                locationManager.requestLocationUpdates("gps", 0, 0, pIntent);
                locationManager.requestLocationUpdates("gps", 0, 0,
                                new LocationListener() {
                                        public void onLocationChanged(Location 
location) {
                                                String locationText = "Location 
changed, current location: "
                                                                + location;
                                                Log.i("hw", locationText);
                                                int lat = (int) Math
                                                                
.round(location.getLatitude() * 1E6);
                                                int lng = (int) Math
                                                                
.round(location.getLongitude() * 1E6);
                                                mController.animateTo(new 
GeoPoint(lat, lng));
                                        }

                                        public void onProviderDisabled(String 
provider) {
                                                Log.i("hw", "Provider " + 
provider + " disabled");
                                        }

                                        public void onProviderEnabled(String 
provider) {
                                                Log.i("hw", "Provider " + 
provider + " enabled");

                                        }

                                        public void onStatusChanged(String 
provider, int status,
                                                        Bundle extras) {
                                                String info = "TEMPORARY 
UNAVAILABLE";
                                                if (status == 
LocationProvider.AVAILABLE) {
                                                        info = "AVAILABLE";
                                                } else if (status == 
LocationProvider.OUT_OF_SERVICE) {
                                                        info = "OUT OF SERVICE";
                                                }

                                                Log.i("hw", "Provider status 
changed:" + info);

                                        }

                                });

        }

        @Override
        protected boolean isRouteDisplayed() {
                return false;
        }
}


Then i've connected with DDMS and sending any gps locations doesn't
work. Neither gpx nor kml files doesn't load to the ddms view too. So
I've connected with adb shell to see /data/misc/location/
<provider_name> folder. But it is missing there is only /data/misc/
hcid directory. Nothing in /data/app folder interesting as well. After
that i've decided to write simple code to mimic gps, here it is:

MockGPS.java:

public class MockGps implements Runnable {
        public static final String PROVIDER_NAME = "test1";
        private LocationManager manager;

        public MockGps(LocationManager manager) {
                this.manager = manager;
                try {
                        manager.addTestProvider(PROVIDER_NAME, false, false, 
false, false,
false, false, false, 0, 1);
                } catch (IllegalArgumentException e) {
                        e.printStackTrace();
                }
                manager.setTestProviderEnabled(PROVIDER_NAME, true);
        }
        public void run() {
                Location l = new Location(PROVIDER_NAME);
                l.setLongitude(30.456789);
                l.setLatitude(-19.234567);
                manager.setTestProviderLocation(PROVIDER_NAME, l);
                Random rand = new Random();
                while(true) {
                        double lat = l.getLatitude();
                        double lng = l.getLongitude();
                        l.setLatitude(lat+rand.nextDouble());
                        l.setLongitude(lng+rand.nextDouble());
                        manager.setTestProviderLocation(PROVIDER_NAME, l);

                        try {
                                Thread.sleep(1000);
                        } catch (InterruptedException e) {
                                Log.e("hw", e.toString());
                        }
                        manager.setTestProviderStatus(PROVIDER_NAME,
LocationProvider.AVAILABLE, null, 50);
                }
        }

}

I've tried both 1.1 and 1.5 SDK neither of those works for me.

Here is LogCat:

05-19 11:56:30.350: DEBUG/LocationManager(732): Constructor: service =
android.location.ilocationmanager$stub$pr...@435c7ab8
05-19 11:56:30.359: DEBUG/LocationManager(732): getAllProviders
05-19 11:56:30.369: INFO/location(732): Providers: [gps, network]
05-19 11:56:30.369: DEBUG/GpsLocationProvider(570): setMinTime 0
05-19 11:56:30.389: DEBUG/GpsLocationProvider(570): setMinTime 0
05-19 11:56:30.528: INFO/MapActivity(732): Handling network change
notification:CONNECTED
05-19 11:56:30.540: ERROR/MapActivity(732): Couldn't get connection
factory client
05-19 11:56:31.278: INFO/ActivityManager(570): Displayed activity
pl.itigo.hw/.HelloWorld: 2207 ms
05-19 11:56:31.420: INFO/hw(732): Provider status changed:TEMPORARY
UNAVAILABLE

After pushing some gps data with DDMS:

05-19 11:58:08.968: INFO/hw(732): Provider status changed:AVAILABLE


And thats all. Please help me with this issue, otherwise i'll get grey
hair. I didn't even try to upload app to the (real) device.




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

3. I can't get into developer.android.com site.

4. Android camera - high resolution image

5. Is there anybody using lookandfeel on android?

6. Focus issue after calling ArrayAdapter.notifyDataSetChanged()

7. Android Bluetooth 2.0 Support