Recent

Author Topic: how to include data file into package?  (Read 4207 times)

fulan

  • Newbie
  • Posts: 2
how to include data file into package?
« on: August 30, 2013, 04:58:08 am »
I want to include data file into package (i'm using androidlcl as project template ). Where do i have to put it in project folder so build_debug_apk  automatically include it in the package.

---
Windows XP, Laz4android1.1-41139

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: how to include data file into package?
« Reply #1 on: August 31, 2013, 05:38:46 pm »
I think that you should put it in the android/res/raw directory (create it if necessary). Then it will put it somewhere in the data directory of the package once installed, not sure where as I never used this myself.

roeug

  • Jr. Member
  • **
  • Posts: 67
    • http://roeug.50megs.com/
Re: how to include data file into package?
« Reply #2 on: January 23, 2014, 05:26:24 pm »
I put bin.data into android\raw\lib\armeabi\lib_my_file_name.so
On device it's copied to /data/data/com.pascal.lcltest/lib/lib_my_file_name.so (if you don't change the package name)
« Last Edit: January 25, 2014, 05:16:26 am by roeug »

truetom

  • Jr. Member
  • **
  • Posts: 73
    • http://sourceforge.net/projects/laz4android/
Re: how to include data file into package?
« Reply #3 on: January 24, 2014, 07:26:51 am »
You should create a new directory "android/assets",then put all data in the directory and edit the build_debug_apk.bat ,find this line:
call aapt p -v -f -M AndroidManifest.xml -F bin\%APP_NAME%.ap_ -I %APK_SDK_PLATFORM%\android.jar -S res -m -J gen raw

change to:
call aapt p -v -f -M AndroidManifest.xml -F bin\%APP_NAME%.ap_ -I %APK_SDK_PLATFORM%\android.jar -S res -m -J gen raw -A assets

Thanks and regards!

laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

roeug

  • Jr. Member
  • **
  • Posts: 67
    • http://roeug.50megs.com/
Re: how to include data file into package?
« Reply #4 on: January 24, 2014, 07:02:02 pm »
Thanks truetom. For assets as I remember there exist some file size limitations (may be, I am wrong)

mmilorad

  • Newbie
  • Posts: 1
Re: how to include data file into package?
« Reply #5 on: January 24, 2014, 08:02:05 pm »
How to use files from Assets directory ? Any example ?

 

TinyPortal © 2005-2018