-1

I have an android application that gets invoked through ADB on a desktop machine. I have a properties file on the desktop machine which the android application somehow needs to be aware of, but they need to be external to the APK.

On the desktop (which will invoke the activities within the APK via ADB) I cannot easily repackage the APK with the .properties file and then re-install the APK on the phone (I tried this via aapt, but it is not preferable because it removes the signature on the APK and I cannot easily resign the apk on the particular desktop machine).

I would rather not pass them via intent extras, as there are a lot of them, and I cannot use adb shell setprop because it doesn't work while the phone is running. I also cannot put them on external storage because I am not guaranteed the phone will have an SD card. Can I put them in "internal storage" somewhere (if that exists) ?

I basically need to be able to pass numerous properties onto the device when I install the APK, but I cannot put them in the APK itself, and not all the devices will have SD cards.

Any ideas ?

jhnclvr
  • 9,137
  • 5
  • 50
  • 55

1 Answers1

0

Take a look at the method used here: android: transfer sqlite database from pc to device via usb programatically

Community
  • 1
  • 1
Nathan Fig
  • 14,970
  • 9
  • 43
  • 57
  • could I put a properties file on the device, if the device has no SD card? Does it have to be a SQLite db? – jhnclvr Jul 01 '11 at 17:18
  • Look at the code - there's nothing restricting this to SQLite files. And as Lin's comment on the OP points out you can write to any part of the device you have permission to - however, I do not know if that will include non-SD partitions. – Nathan Fig Jul 01 '11 at 17:30
  • That is the main problem I am facing is that I cannot write to an SD card (also can't repack the APK). There will be many different devices possibly with different file system layouts (I don't know), so I guess I am wondering if there is a non-SD card file location I can safely write the props file to on all devices? – jhnclvr Jul 01 '11 at 17:47
  • I'm going to mark this as an answer and hope such a location exists. I will ask a new question about such a location. Thanks for the help – jhnclvr Jul 01 '11 at 19:10