Forum > Android

[Solved] Lost with creating Android project structure

(1/2) > >>

huberte:
Hi,

Could it be possible to show me something more explicit than

http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android

--- Quote ---Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.
--- End quote ---

I'm quite lost.

thks.

huberte:
Can someone explain me which file from androidlcl I have to modify, copy or paste to build my own app ? I'm using the vbox image.

http://pastebin.com/37WtWFSH

thanks.

huberte:
spent about 10 hours on this

I'm gonna make a first part :


--- Quote ---To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl
--- End quote ---

done, but I don't know where the build and java files really are...


--- Quote ---You need a separate LPI at the moment for the Android version of the application but all the rest of the code can be shared. Create it using the template for a "Library" and then adapt the code from the example located in the lazarus source code in lazarus/examples/androidlcl
--- End quote ---

Library ? : http://wiki.lazarus.freepascal.org/shared_library ?


--- Quote ---Then you will need to modify the build files to change them to your new project name and your new Java package name.
--- End quote ---

Lost

felipemdc:

--- Quote from: huberte on April 19, 2012, 02:29:35 am ---
--- Quote ---To create a new LCL-CustomDrawn-Android application simply copy all of the file structure and build and java files from the example project called "androidlcl". This example can be obtained from the Lazarus source tree in lazarus/examples/androidlcl
--- End quote ---

done, but I don't know where the build and java files really are...
--- End quote ---

The file structure of the example project looks like this:

lazarus/examples/androidlcl/*
lazarus/examples/androidlcl/android/*
lazarus/examples/androidlcl/android/src/com/pascal/lcltest/  <-- Here is the java source file

Note com/pascal/lcltest is the *package name* of the project. You need to decide your own package name. And then create your own structure:

myproject/ <- here copy everything from androidlcl/
myproject/android/src/com/mycompanyname/myprojectname/ <-- Here put the java source file

All changes need to be reflected in the ANT build files. Also open the java source file, I think you will need to change the package name there too. And you will also have to change the package name in the exported routine names in your main library file.


--- Quote ---Library ? : http://wiki.lazarus.freepascal.org/shared_library ?
--- End quote ---

Yes


--- Quote ---Then you will need to modify the build files to change them to your new project name and your new package name.
--- End quote ---

Open the directory lazarus/examples/androidlcl/android/

Now read *all* files directly inside this directly using a text editor. Note all the places which have paths, project names and package names.

huberte:
thanks


--- Quote ---All changes need to be reflected in the ANT build files.
--- End quote ---

Where ?


--- Quote ---And you will also have to change the package name in the exported routine names in your main library file.
--- End quote ---

Link ? Cause I have many many files in the example folder's root (androidlcltest (lpi, lpr lps) mainform non androidtest secondform)


--- Quote ---
--- Quote ---Library ? : http://wiki.lazarus.freepascal.org/shared_library ?
--- End quote ---

Yes
--- End quote ---

Not helping further. I thought I could add this line 
--- Code: ---library androidlcltest;
--- End code ---
to the top of my own project.


--- Quote ---Open the directory lazarus/examples/androidlcl/android/
Now read *all* files directly inside this directly using a text editor. Note all the places which have paths, project names and package names.

--- End quote ---

Seems there is only build.sh unless I have to open ALL files in all folders.

For example, here are the file with LCLexample :

--- Quote ---Search "LCLexample" (3 hits in 3 files)
 \android\.svn\text-base\build.sh.svn-base (1 hits)
   Line 3: ~/Programas/android-sdk-linux/platform-tools/adb install bin/LCLExample-debug.apk
  \android\.svn\text-base\build.xml.svn-base (1 hits)
   Line 2: <project name="LCLExample" default="help">
  \android\build.xml (1 hits)
   Line 2: <project name="LCLExample" default="help">

--- End quote ---

AndroidManifest needs to be update too, right ? How ? Using a texte editor ?

Step 3 is driving me crazy


--- Quote ---Besides the LCL project building, such as configuring a proper LPI and having a library main project file, one also needs to add all of the android project structure. Simply copy from the example project in lazarus/examples/androidlcl and adapt it to the new project. Things to change are the path to the SDK, the package name. The package name needs to be updated in the build files, in the directory structure android/src/packagename, in the activity java source code and also in the main library pascal source in the exports section.
--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version