Android

Failed to install apk on device timeout

Posted on

In Eclipse ADT, Whenever you’re trying to run app on Android phone by connecting phone to PC. You may see this error Failed to install apk on device timeout. The reason for it ADB connection is closing before running app on device. To fix this issue you need to change ADB Connection timeout settings. Please […]

Android

How to send zip file as attach in email client

Posted on

Hi Guys, When I’m trying to attach zip file to a mail composer. I tried following code //this is a String variable used for file path. String STORAGE_ZIP_FILE=Environment.getExternalStorageDirectory().getPath() + “/MyProj/test.zip”; Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_SUBJECT, “Person Details”); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(STORAGE_ZIP_FILE)); sendIntent.setType(“text/html”); startActivity(sendIntent); But, I see runtime error as it displayed a toast message saying this […]

Android

XStream ConversionException: Cannot construct it does not have a no-args constructor

Posted on

Hi Guys, While using XStream to parse XML in my app, I see app crash due to this parse issue as ConversionException Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct <ClassName> as it does not have a no-args constructor : Cannot construct <ClassName> as it does not have a no-args constructor I see the issue is due to inner class, […]

Android

Set ImageView width and height programmatically?

Posted on

To set ImageView width and height programmatically imageview.getLayoutParams().height = 20; here imageview is instance of ImageView. Important: If you’re setting the height after the layout has already been ‘laid out’, then make sure you call imageview.requestLayout() Here is the ref link, credits to Hakem Zaied Hope this helps.