HelloWorld problems

by maciejg » Wed, 29 Apr 2009 15:04:12 GMT


Sponsored Links
 Hi,
I've just installed the SDK and followed the instructions in 'Hello
World' section. Although everything seemed fine Eclipse keep returning
the 'Failed to find an AVD compatible with target 'Android 1.5'.
Launch aborted.' error.
I have created the AVD with 'android create avd --target 1 --name
myavd' command as instructed.

After running the 'android list avd' command I noticed that an AVD
with Android 1.1 is the only one available. I did create another
project and used the Android 1.1 and everything seems to work. But the
questions are: shall I change the AVD to 1.5? How? Why the default is
1.1?

Thanks in advance for any replies.
Maciej

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



HelloWorld problems

by peter.kullm...@googlemail.com » Thu, 30 Apr 2009 02:05:51 GMT


 Hi,


Probably, because there isn't one.


Well, yes, the one you created. If you want to see the available
*targets*, use

android list targets

But you still have to create an avd for that target to have one
available.


You can either change the API level of your failing app to 1.1 in the
properties dialog of the project or use an appropriate avd which is
created by

android create avd --target 3 --name myavd-1.5

Peter

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


Sponsored Links


Other Threads

1. DroidDrop - Remote Logging with source code

Drop.io provides private file storage and sharing in "drops."

DroidDrop Remote Logging provides the ability to log data from your
applications to a drop on drop.io.
Watch the 2 minute YouTube demo here: http://www.youtube.com/watch?v=OWwfp1cQ8WA

Source and how-to info is on GitHub.
The jar file for remote logging adds 16K to your apk.
http://github.com/CarmenD/DroidDrop--Remote-Logging

My goal in the remote logging release was to:
- deliver something useful to Android developers
- get some usage and feedback
- make at least a limited version of the drop.io client code available
- get something out that required very limited testing!

I'll be blogging and writing more about this.

Carmen
--
Carmen
http://www.twitter.com/CarmenDelessio
http://www.talkingandroid.com
http://www.facebook.com/BFFPhoto
http://www.twitter.com/DroidDrop


-- 

2. problem reading from the Camera

Hello all ! My app will show the current image from the camera and
bellow the binary version of the image black and white, and will write
some different algorithms make the binary image.

I'm having and error when I try to read from the camera:
11-05 02:27:15.357: ERROR/camera(736): not able to link with the
camera

and after that in my app I have the following
11-05 02:27:15.357: ERROR/camera(736): java.lang.NullPointerException
11-05 02:27:15.357: ERROR/camera(736):     at
com.athanazio.android.camerabinaria.Main.onCreate(Main.java:29)
11-05 02:27:15.357: ERROR/camera(736):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
11-05 02:27:15.357: ERROR/camera(736):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
11-05 02:27:15.357: ERROR/camera(736):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
11-05 02:27:15.357: ERROR/camera(736):     at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
11-05 02:27:15.357: ERROR/camera(736):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
11-05 02:27:15.357: ERROR/camera(736):     at
android.os.Handler.dispatchMessage(Handler.java:99)
11-05 02:27:15.357: ERROR/camera(736):     at android.os.Looper.loop
(Looper.java:123)
11-05 02:27:15.357: ERROR/camera(736):     at
android.app.ActivityThread.main(ActivityThread.java:3948)
11-05 02:27:15.357: ERROR/camera(736):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-05 02:27:15.357: ERROR/camera(736):     at
java.lang.reflect.Method.invoke(Method.java:521)
11-05 02:27:15.357: ERROR/camera(736):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
11-05 02:27:15.357: ERROR/camera(736):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
11-05 02:27:15.357: ERROR/camera(736):     at
dalvik.system.NativeStart.main(Native Method)

I noticed this in the LogCat before the problem that I had
11-05 02:27:14.937: ERROR/MediaPlayer(554): Unable to to create media
player
11-05 02:27:14.947: ERROR/CameraService(554): Failed to load
CameraService sounds.
11-05 02:27:14.957: ERROR/MediaPlayer(554): Unable to to create media
player
11-05 02:27:14.977: ERROR/CameraService(554): Failed to load
CameraService sounds.

this is my current code
package com.athanazio.android.camerabinaria;

import java.io.IOException;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.PreviewCallback;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;

public class Main extends Activity {

        Camera camera;

        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);

                try {
                        camera = Camera.open();
                        SurfaceView original = (SurfaceView) 
findViewById(R.id.original);
                        camera.setPreviewDisplay(original.getHolder());
                        Parameters cameraParameters = camera.getParameters();
                        cameraParameters.setPreviewFormat(PixelFormat.RGB_888);

                        camera.setPreviewCallback(new PreviewCallback() {
                                SurfaceView changed = (SurfaceView) 
findViewById(R.id.changed);

                                public void onPreviewFrame(byte[] _data, Camera 
_camera) {
                                        Bitmap bitmap = 
BitmapFactory.decodeByteArray(_data, 0,
                                                        _data.length);

                                        Canvas canvas = new Canvas();
                                        canvas.drawBitmap(bitmap, 0, 0, null);
                                        changed.draw(canvas);
                                }
                        });

                        camera.startPreview();

                } catch (Exception e) {
                        showMessage("error", "not able to use the camera");
                        Log.e("camera", "not able to link with the camera", e);
                }

                setContentView(R.layout.main);
        }


        void showMessage(CharSequence title, CharSequence message){
                Builder builder = new AlertDialog.Builder(this);
                builder.setTitle(title);
                builder.setMessage(message);
                builder.show();
        }

        protected void onDestroy() {
                super.onDestroy();
                if (camera != null) {
                        camera.stopPreview();
                        camera.release();
                }
        }
}

any toughts ?

-- 

3. Application is not installed on your phone ERROR while launching the application?

4. Where do I write my changelog?

5. about the signature permission - what happen if the declaring app is uninstalle

6. Possible bug with Intents and PendingIntents on Android 2.0 AVD

7. error when starting Android project in Eclipse