Can not read apk file on android emulator - SDK 1.1

by » Thu, 30 Apr 2009 02:05:56 GMT

Sponsored Links

It seems my code cannot read an apk File I have created on the Android

- First off, I created an sdcard with command 'mksdcard ...'
- then I run this code:

------------- Begin Cut Here --------------->

File tmpdir = new File(tmpdirpath+name);

if (!tmpdir.exists())
  boolean b = tmpdir.mkdirs();
  if (!tmpdir.isDirectory())
   throw new RuntimeException("here : the tmp dir conflicts");
File apk = new File(tmpdirpath + name + "/" + name + ".apk");
if (!apk.exists())
// with name = name of my apk file.

------------- End Cut Here --------------->

- The apk file is successfully created on a temporary directory on /
but I have no permissions to read it:

- - - - r w - r w -

- I tryed to change them:
# adb shell
# chmod 777 myFile.apk

No error but permissions remain the same

- - - - r w - r w -

and I get the following exception:
        04-28 14:56:16.296: ERROR/dalvikvm(231): Can't open dex cache '/data/
        No such file or directory
        04-28 14:56:16.296: INFO/dalvikvm(231): Unable to open or create
        for /sdcard/.tmpdir/org.python.pycode._pyx0/
        04-28 14:56:16.306: WARN/System.err(231): unable
        to open DEX file
        04-28 14:56:16.326: WARN/System.err(231):     at
        dalvik.system.DexFile.openDexFile(Native Method)
        04-28 14:56:16.336: WARN/System.err(231):     at
        04-28 14:56:16.346: WARN/System.err(231):     at
        04-28 14:56:16.355: WARN/System.err(231):     at

Can somebody help please?


Other Threads

1. background blur is not working with android 2.0


I am working on the android application with eclair.

I have used the api demos as per the following link but it seems that
the background is not making blur with TranslucentBlurActivity class
used in api demos.

Please go through the link and suggest the proper solution if any.

Can anyone suggest me the solution???


2. Adding menu items in a WebView context menu

One possible reason you're not seeing your context menu is that you may
not be in your app.

Clicking a link in a WebView, by default, launches the Browser
application. You have to set up a WebViewClient that overrides
shouldOverrideUrlLoading() and use that, along with loadUrl(), to trap
links and keep them in the WebView.

Mark Murphy (a Commons Guy) |

Android Online Training: 26-30 April 2010:


3. Narsis Sore2

4. porting android to OMAP 3530 with Torpedo SOM

5. Android Device Seeding Program - Differences in phone for developers?

6. Regarding Rotation event

7. AsyncTask : all onProgressUpdate() done at the end of task