Starting an AVD from a custom location

by Patrick » Mon, 28 Jun 2010 16:55:28 GMT


Sponsored Links
 Hallo!

I want the android emulator to start a AVD from a non default location
using the following command:
./android-sdk-linux_86/tools/emulator -sysdir /opt/
development/.android/avd/ -avd AVD1.6_HTC_SD

The .android directory is a copy from the default .android directory
from my homefolder...

The emulator states the following:
emulator: ERROR: unknown virtual device name: 'AVD1.6_HTC_SD'
emulator: could not find virtual device named 'AVD1.6_HTC_SD'

Any ideas?

--



Starting an AVD from a custom location

by Xavier Ducrohet » Tue, 29 Jun 2010 03:58:50 GMT


 -sysdir cannot be used with AVDs.

you can overide the location of the .android folder by setting an env
var call ANDROID_SDK_HOME.

In your case, you should try:
$ ANDROID_SDK_HOME=/opt/development emulator -avd AVD1.6_HTC_SD

Xav



>


Sponsored Links


Other Threads

1. warn about autorun.inf on the sdcar

Theres a story making the rounds about someone claiming to have found
a windows autorun virus on the sdcard of a new phone.  As this has
happened with a number of other devices, the risk seems real no matter
what the facts of that story turn out to be - even if the virus got on
there after shipping, being a propogation vector is undesirable.

It seems to me however that while android devices can function as usb
mass storage drives, they have the advantage of being a lot smarter.
It would be a fairly simple matter to have the phone check for the
presence of an autorun.inf on the card when the user enables usb
mounting.  If its found, the user could be warned, shown the file and
offered some choices - approve & mount, remove, links to av resources
online, etc.   If the user approves a cryptographic hash of the
autorun.inf could be stored in onboard storage so that file doesnt
prompt another warning.

2. how to crop an image in android 2.x

I need to crop an image whose Uri is known.

In 1.6 I used the below code.

 Intent i = new Intent("com.android.camera.action.CROP");
 i.setClassName("com.android.camera", "com.android.camera.CropImage");
 i.setData(imageUri);      // imageUri = 
content://media/external/images/media/40
 i.putExtra("noFaceDetection", false);
 i.putExtra("outputX", 75);
 i.putExtra("outputY", 75);
 i.putExtra("aspectX", 1);
 i.putExtra("aspectY", 1);
 i.putExtra("scale", true);

 ContentValues values = new ContentValues();
 values.put(Media.TITLE, "User_t" + "_Image");
 values.put(Media.BUCKET_ID, "User-T");
 values.put(Media.BUCKET_DISPLAY_NAME, "image_t");
 values.put(Media.IS_PRIVATE, 1);
 userThumbnailUri = getContentResolver().insert(
                        Media.EXTERNAL_CONTENT_URI, values);
 i.putExtra(MediaStore.EXTRA_OUTPUT, userThumbnailUri);
startActivityForResult(i, CROP_IMAGE);


It worked fine on 1.6 but when i tested it on 2.1 it give error as
shown below.

02-12 19:09:43.504: ERROR/AndroidRuntime(851):
java.lang.RuntimeException: Failure delivering result
ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://
media/external/images/media/40 }} to activity {net.urbansignals/
net.urbansignals.activity.user.SignUpActivity}:
java.lang.SecurityException: Permission Denial: starting Intent
{ act=com.android.camera.action.CROP dat=content://media/external/
images/media/40 cmp=com.android.camera/.CropImage (has extras) } from
ProcessRecord{44ae1ac8 851:net.urbansignals/10045} (pid=851,
uid=10045) requires null
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityThread.deliverResults(ActivityThread.java:3329)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityThread.handleSendResult(ActivityThread.java:3371)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityThread.access$2700(ActivityThread.java:119)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1893)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.os.Handler.dispatchMessage(Handler.java:99)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.os.Looper.loop(Looper.java:123)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
java.lang.reflect.Method.invokeNative(Native Method)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
java.lang.reflect.Method.invoke(Method.java:521)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
dalvik.system.NativeStart.main(Native Method)
02-12 19:09:43.504: ERROR/AndroidRuntime(851): Caused by:
java.lang.SecurityException: Permission Denial: starting Intent
{ act=com.android.camera.action.CROP dat=content://media/external/
images/media/40 cmp=com.android.camera/.CropImage (has extras) } from
ProcessRecord{44ae1ac8 851:net.urbansignals/10045} (pid=851,
uid=10045) requires null
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.os.Parcel.readException(Parcel.java:1218)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.os.Parcel.readException(Parcel.java:1206)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:
1214)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.Instrumentation.execStartActivity(Instrumentation.java:
1373)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.Activity.startActivityForResult(Activity.java:2749)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
net.urbansignals.activity.user.SignUpActivity.onActivityResult(SignUpActivity.java:
326)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.Activity.dispatchActivityResult(Activity.java:3828)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     at
android.app.ActivityThread.deliverResults(ActivityThread.java:3325)
02-12 19:09:43.504: ERROR/AndroidRuntime(851):     ... 11 more


Can any body suggest the proper way do crop an image in 2.x ?

Thanks for your suggestions.

-- 

3. cara partisi N1

4. (WTA) Kembaliin ukuran sd card bekas partisi

5. Kartu Indosat dgn nomer 0814 yg kemarin beli di Expo

6. IRC lagiiii yuuu...

7. Penasaran sama blapk market