Welcome, Guest
Username: Password: Remember me
CodeTyphon Android Development, LAMW, etc, discussions and problems
  • Page:
  • 1

TOPIC:

I have found ready to use solution on how to pack the application to *.APK file. 1 month 1 week ago #19007

  • Ak.Saharov
  • Ak.Saharov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 1
I have read this wiki article "Cross-build for Android".

pilotlogic.com/sitejoom/index.php/wiki/1...als/cross-build.html

In the end of it, it is said that
"For Deploy your new application, or how to pak your app to *.APK file,
Please seach to the web..."

I have started to search to the web...

On SourceForge.net I have found ready to use example made by Key-Real.

He is from Hamburg, Germany.

He made Pascal program for Android Camera.

!!!With Android permissions granted for Camera and Storage!!!.

Here is the link.

sourceforge.net/p/nativeandroidcamera/code/ci/master/tree/


I think, I have found out some main ideas of this example: 

1. Pascal program must be library unit to create .so file.

2. Because .so file is library in Android.

3. As library unit program must have external function to import.

4. To start the application on Android device the external function of the .so file must be set as application.MainActivity in Manifest file for Android.

5. After producing .so file it has to be copied into "lib" folder of Android application template given by the author.



I think, that this example could be used as Template to create any other Pascal application for Android.

Because:

1. The author has created all folders requried to create APK with Manifest file. 

2. The author has created ready to use build-script to create signed APK and sign it.


Script named doit can be found in the root folder!


All you need is to change the content in the folders of the APK template. 

sourceforge.net/p/nativeandroidcamera/code/ci/master/tree/apk/


And run the script named doit.

I think, it is great!

Author done well!
The following user(s) said Thank You: choki

Please Log in or Create an account to join the conversation.

I have found ready to use solution on how to pack the application to *.APK file. 1 day 5 hours ago #19064

  • Ak.Saharov
  • Ak.Saharov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 1
Because of apk file in repository is broken, in attach there is ready to use apk. 

It works on my Android 12. 

Install it, close it after installation, do not open, then launch it again.

Of course, this example could be better if there were Forms and buttons added.

To manage camera.

In such case, I think, the library file .so for Android should be compiled with LCLWidgetType=customdrawn as it support Android graphics.

And OpenGLES30.pas library could be replaced with OpenGL components.

File Attachment:

File Name: myapp.zip
File Size:1,899 KB
Attachments:

Please Log in or Create an account to join the conversation.

I have found ready to use solution on how to pack the application to *.APK file. 1 day 3 hours ago #19065

  • Ak.Saharov
  • Ak.Saharov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 1
If you have troubles with building apk file, you can use the apk file from attach in previous message.

1. Change extension of myapp.apk file to myapp.zip.

2. Open it with any unzip application. I use WinRar.

3. Go to lib folder inside archive.

4. Replace library files .so in folder arm64-v8a for Android 64 and in folder armebi-v7a for Android 32.

5. Save changes to archive and close it.

6. Change back extension from myapp.zip to myapp.apk.

7. Sign modified apk with any apk manager. I use MT Manager.


Notice while changing code in mynativeapplication.pas library file do not touch the names of exported function.
 
These function are required for Java and Android to launch the app.

The link to the mynativeapplication.pas library file is still active. 
Here it is.
sourceforge.net/p/nativeandroidcamera/co...mynativeapplication/


Key-real, the author of the project, really done well!


 

Please Log in or Create an account to join the conversation.

  • Page:
  • 1