Recent

Author Topic: Android Module Wizard  (Read 707281 times)

osvaldotcf

  • New Member
  • *
  • Posts: 15
Re: Android Module Wizard
« Reply #270 on: January 25, 2015, 11:01:55 pm »
Gentlemen, anyone could look at this ? The use of Lazarus Android Module Wizard components on Linux, Ubuntu 14.04 64 bit

https://github.com/jmpessoa/lazandroidmodulewizard/issues/1

The steps are correct ?
« Last Edit: January 26, 2015, 02:32:24 am by osvaldotcf »

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #271 on: January 30, 2015, 09:17:27 pm »
Hello guys, I want to prepare a virtual machine (linux) with everything already installed. I want to know the right steps to do

1. Install the Java JDK
2. Install Android-study
3. Install ndk
4. Install Lazarus
5. Install the compiler arm-android (which guide I follow?)

What else?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android Module Wizard
« Reply #272 on: January 31, 2015, 07:07:59 am »
Hello guys, I want to prepare a virtual machine (linux) with everything already installed. I want to know the right steps to do

1. Install the Java JDK
2. Install Android-study
3. Install ndk
4. Install Lazarus
5. Install the compiler arm-android (which guide I follow?)

What else?
2 -> Install Android sdk, anything else but the sdk is useless for development with this package
5 -> any guide that can help you create arm-android cross compiler, the Android wiki article should have the pointer
what else -> clone and install the package

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #273 on: January 31, 2015, 05:41:41 pm »
Hi All!

There is an updated "Lamw" in GitHub: Added support to "core" Android!

ref: https://github.com/jmpessoa/lazandroidmodulewizard

[zip]: https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip

Version 0.6 - rev. 13 - 29 January 2015 -

   NEW! Added component jBroadcatReceiver [Android Bridges Extras]
   NEW! Demo AppBroadcatReceiverDemo1 [Eclipse Compatible Project]

   NEW! Added component jSensorManager [Android Bridges Extras]
   NEW! Demo AppSensorManagerDemo1 [Eclipse Compatible Project]
   NEW! Demo AppSensorManagerDemo2[Eclipse Compatible Project]

   NEW! Added component jIntentManager [Android Bridges Extras]
   NEW! Demo AppIntentManagerDemo1 [Eclipse Compatible Project]
   NEW! Demo AppIntentManagerDemo2 [Eclipse Compatible Project]
   NEW! Demo AppIntentManagerDemo3 [Eclipse Compatible Project]

   NEW! New jComponent [Create] Expert
      IDE "tools" -> "Android Module Wizard" -> "New jComponent [Create]"
         Please, read the Tab "Help" ....

   New! Added Options to Select[prebuilt] System = (Windows, Linux-x86, Mac, Linux-x86_64)
      :: A suggestion by @osvaldotcf [Thank you!]

   UPDATED! All Demos updated!

   *****************************************
   * To start:            
   *               
   * "install_tutorial_ant_users.txt"   
   * "install_tutorial_eclipse_users.txt"                                  
   *               *
   *****************************************

Thanks to All!

Ps: "Lamw" remind "lemur" ....  :D :D :D
« Last Edit: February 01, 2015, 06:17:31 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Android Module Wizard
« Reply #274 on: February 06, 2015, 09:16:32 pm »
Hello, I created a virtual machine with linux installed on top of everything. Now I would like to understand how to create a new project without using eclipse. Can you?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #275 on: February 06, 2015, 11:37:41 pm »
Hi xinyiman,

Yes, you can....

Just Select to Ant project!

ref. picture:    https://jmpessoa.opendrive.com/files?Ml83NTc1NzU5Ml9tazVLdg
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ps

  • Full Member
  • ***
  • Posts: 136
    • CSS
Re: Android Module Wizard
« Reply #276 on: February 07, 2015, 07:14:40 pm »
Very nice work, but it's realy hard to get working setup. Now I'm done. Here are some hints:
  • BackgroundColor is TARGBColorBridge ... why?  :o  I need custom colors.
  • FontColor - same as BackgroundColor
  • jHTTPClient - Basic Authentication missing, and POST (for RESTful access)
  • jWebView - Basic Authentication missing
Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #277 on: February 07, 2015, 08:22:27 pm »
Hi Ps,


1.
Code: [Select]
..but it's realy hard to get working setup. ...
Can you help here! What about a new  "Get Start!" tutorial? Help me!

2 and 3.
Code: [Select]
...BackgroundColor is TARGBColorBridge ... why?  :o  I need custom colors..
I do not understand .... any sugestion?

4 and 5. [jHTTPClient, jWebView]

Ok, I'll try to improve its....

Thank you!


Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

ps

  • Full Member
  • ***
  • Posts: 136
    • CSS
Re: Android Module Wizard
« Reply #278 on: February 08, 2015, 07:32:15 am »
Can you help here! What about a new  "Get Start!" tutorial? Help me!
I can look at this.

And for colors, I need do this:
Code: [Select]
jTextView1.BackgroundColor := $FF2C2F3E;
For testing I created code like this and it's working:
Code: [Select]
....
   procedure SetBackColor (Value: DWord);
...
    property BackgroundColor     : TARGBColorBridge read FColor     write SetColor;
    property BackColor: DWord read FBackColor Write SetBackColor;       

...


procedure jTextView.SetBackColor(Value: DWord);
begin
  FBackColor:= Value;
  if (FInitialized = True) and (FBackColor <> $00000000)  then
    View_SetBackGroundColor(FjEnv, FjObject , Value);
end; 

Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

renabor

  • Jr. Member
  • **
  • Posts: 73
Re: Android Module Wizard
« Reply #279 on: February 08, 2015, 10:12:26 am »
Here my modified version for installing fpc, lazarus and lazandroidmodulewizardwith on Ubuntu 14.04 64 bit:
-----------------
install some necessary stuff:
sudo apt-get install adb ant fp-compiler openjdk-7-jdk
mkdir ~/Android
cd ~/Android
_Get Android SDK and NDK.
_Create a simbolic link (ln -s) to your sdk/ndk folder (~/Android -> /your/folder/ (ndk and sdk))
_Add to your ~/.bashrc:
export PATH=$PATH:~/Android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin
_Download with svn
svn co http://svn.freepascal.org/svn/lazarus/branches/trunk/
svn co http://svn.freepascal.org/svn/fpc/branches/trunk/
###  ###
(ref.: http://wiki.freepascal.org/How_to_setup_a_FPC_and_Lazarus_Ubuntu_repository)
sudo apt-get install libgtk2.0-dev, libgdk-pixbuf2.0-dev, libgpm-dev, fakeroot, libncurses5-dev, libtinfo-dev

- BUILD FPC.DEB AND FPC-SRC.DEB
ENTER the directory:
cd ~/Android/lazarus/tools/install
EXECUTE:
./create_fpc_deb.sh fpc /home/user/Android/fpc/
REMOVE all fpc deb and fp_ deb (fpc, fpc-src, fp_compiler and so on)
sudo dpkg --remove fpc* fp-*
INSTALL the new fpc package:
sudo dpkg -i ./fpc_3.1.1-150130_amd64.deb
CREATE fpc-src:
./create_fpc_deb.sh fpc-src //home/user/Android/fpc/
INSTALL fpc_src:
sudo dpkg -i fpc-src_3.1.1-150130_amd64.deb

- BUILD LAZARUS.DEB
./create_lazarus_deb.sh append-revision
REMOVE all lazarus deb
sudo dpkg --remove lazarus* lcl-* lcl
INSTALL the new lazarus package:
sudo dpkg -i lazarus_1.5.47565-0_amd64.deb

### ###
- BUILD THE CROSS COMPILER
make clean crossall OS_TARGET=android CPU_TARGET=arm
sudo make crossinstall OS_TARGET=android CPU_TARGET=arm INSTALL_PREFIX=/usr
_create simbolic link:
cd /usr/bin
sudo ln -s /usr/lib/fpc/3.1.1/ppcrossarm .
sudo ln -s /usr/bin/ppcrossarm ppcarm
sudo ln -s ~/Android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as
sudo ln -s ~/Android/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld.bfd /usr/bin/arm-linux-androideabi-ld
ln -s /usr/bin/arm-linux-androideabi-as /usr/bin/arm-linux-as
ln -s /usr/bin/arm-linux-androideabi-ld /usr/bin/arm-linux-ld
########## compile dummylibs
cd ~/Android/lazandroidmodulewizard/linux/dummylibs
ln -s /home/renabor/Android/lazandroidmodulewizard/linux/dummylibs/libglesv1_cm.so libGLESv1_CM.so
ln -s /home/renabor/Android/lazandroidmodulewizard/linux/dummylibs/libglesv2.so libGLESv2.so

_Add lines below to /etc/fpc.cfg
#IFDEF ANDROID
#IFDEF CPUARM
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
#ENDIF
#ENDIF


Now follow the instructions in: install_tutorial_ant_users.txt
                        1. From Lazarus IDE - Install Wizard Packages

                        1.1 Package -> Open Package -> "tfpandroidbridge_pack.lpk"  [Android Components Bridges!]
                                Ref. image: https://www.opendrive.com/files?Ml8zNjMwNDQ3NF83SzhsZg

                        1.1.1 From Package Wizard
                                - Compile
                                - Use -> Install
                        1.2 Package -> Open Package -> "lazandroidwizardpack.lpk"
                        1.2.1 From Package Wizard
                                - Compile
                                - Use -> Install

                        1.3 Package -> Open Package -> "amw_ide_tools.lpk"  [folder: ..\LazAndroidWizard\ide_tools]
                        1.3.1 From Package Wizard
                                - Compile
                                - Use -> Install
                                ref. https://jmpessoa.opendrive.com/files?Ml82Nzg4MzAyNF9leGVIVg

        1. From Lazarus IDE menu Tools -->> "Android Module Wizard" --> Paths Settings"

                ref. https://jmpessoa.opendrive.com/files?Ml82Nzg4MzA1OF9yVVU3RA

                -Path to Java JDK

                  ex. /usr/lib/jvm/java-7-openjdk-amd64

                -Path to Android SDK

                  ex. /home/renabor/Android/Sdk

                -Select Ndk version: [10]

                -Path to Ndk

                  ex.  /home/renabor/Android/android-ndk-r10d

                -Path to Java Resources  [Simonsayz's Controls.java,  *.xml and default Icons]:

                  ex. /home/renabor/Android/lazandroidmodulewizard/java

                -Path to Lazbuild

                  ex. /usr/bin


- BUILD YOUR FIRST PROJECT
Open a project from lazandroidmodulewizard/demos/Ant or lazandroidmodulewizard/demos/Eclipse directory
open ~/Android/lazandroidmodulewizard/demos/Eclipse/AppDemo1/jni/controls.lpi
from Project->Options, change/modify paths according to your system (under «paths» and «other»)
build it!
Now enter the shell, and cd's into ~/Android/lazandroidmodulewizard/demos/Eclipse/AppDemo1
edit build.sh and modify to reflect your system:

<?xml version="1.0" encoding="UTF-8"?>
<project name="AppDemo1" default="help">
<property name="sdk.dir" location="/home/renabor/Android/sdk"/>
<property name="target"  value="android-19"/>
<property file="ant.properties"/>
<fail message="sdk.dir is missing." unless="sdk.dir"/>
<import file="${sdk.dir}/tools/ant/build.xml"/>
</project>

edit build.sh and leave only this line:
ant -Dtouchtest.enabled=true debug

- FROM COMMAND LINE
chmod +x ./build.sh
./build.sh
cd bin
~/Android/sdk/tools/android avd &
adb install AppDemo1-debug.apk

Enjoy!
« Last Edit: February 22, 2015, 06:17:50 pm by renabor »
FPC 3.2.2 | Lazarus 2.2.3 | Kubuntu 22.04 64bit

ps

  • Full Member
  • ***
  • Posts: 136
    • CSS
Re: Android Module Wizard
« Reply #280 on: February 08, 2015, 01:10:20 pm »
Next hints for enhance:
  • jEditText - Softkeyboard (prevent fullscreen keyboard in landscape mode switch)
  • jEditText - BorderColor (Frame?)
  • jEditText - HintText
  • jEditText - HintTextColor

Softkeyboard

Controls.java

Import part:
Code: [Select]
import android.view.inputmethod.EditorInfo;Source:
Code: [Select]
public  void setInputTypeEx(String str) {
  bufStr = new String(str.toString());
this.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);

...

BorderColor
Remove border(frame):
Code: [Select]
this.setBackgroundColor(0);
HintText
Code: [Select]
this.setHint("This will be hint when edit box is empty");
PS: don't know anything about Java :)
Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #281 on: February 15, 2015, 02:21:40 pm »

Hi All!

Lamw: Lazarus Android Module Wizard [GitHub UPDATED!]

https://github.com/jmpessoa/lazandroidmodulewizard

Version 0.6 - rev. 14 - 13 February 2015 -

   NEW! Added support to Touch Gesture: Pinch/Zoom and Fling[Swipe]!
      :: [jPanel] Added/News events support:  OnFlingGesture and OnPinchZoomGesture

   NEW! Demo AppPinchZoomGestureDemo1 [Eclipse Compatible Project]
   NEW! Demo AppFlingGestureDemo1     [Eclipse Compatible Project]

   UPDATED! Demo AppActionBarTabDemo1 [Eclipse Compatible Project]
      :: Added support to gesture OnFlingGesture [swipe] //<<-A suggestion and request by Derit Agustin

   NEW! Added component jNotificationManager[Android Bridges Extras]
   NEW! Demo AppNotificationManagerDemo1[Eclipse Compatible Project]

   NEW! Added component jDatePicker[Android Bridges Extras]
   NEW! Added component jTimePicker[Android Bridges Extras]
   NEW! Demo AppDateTimePicker[Eclipse Compatible Project]

   IMPROVEMENTS:   jEditText :: Added/New method: SetImeOptions   //Thanks to @Ps
         All jVisualControl: Added Custom Color Support //Thanks to @Ps                
   UPDATED! Demo AppEditTextDemo1[Eclipse Compatible Project]
   
   UPDATED! All Demos updated!

Thanks to All!

Ps. @Ps,  thank you!
      @ renabor, thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

rx3.fireproof

  • New Member
  • *
  • Posts: 49
Re: Android Module Wizard
« Reply #282 on: February 15, 2015, 03:45:44 pm »
Hello

Thank you for Your work.

I have made a small calculator for my purpose.
Working time about 2 weeks  with studying and drawing.

Project properties
ANT
SDK tool Built 21.1.2
NDK 10C
Android 14
Target Android-17

I can give you the link on the result of me work if you are interested in it.

There were some difficulties.
I have some suggestions about the future versions, if it is possible to produce.
Sorry for non-professional description of the problems and advice. I am a chemist.

1. Failed to delete <uses-permission android:name="android.permission.READ_PHONE_STATE"/>. The app crashes.


2. For displaying  data from database and SQL queries used spinner

- spinner does not show more than 80-100 items (depends on number of characters), the app crashes;
- does not «count», and almost all properties and procedures  «item».
-  need the event   “onclick”  without selection;
- need «fontsize»;

3. «Jedittext»
- need the property «readonly» type;
- need an event type «onexit»;
- if форm 8 “Jedittext” with “maxtextlengh =300”, the app crashes;

4. Form.
- if create a form with “actRecyclable” or “actSplash” from form with “actRecyclable” or “actSplash” (3 form), does not work «backbutton» in the first form with “actMain”;
- Could not make FreeAndNill to form with «actRecyclable» or «actsplash».

5. The problem with string concatenation.
- this code does not work

var
A:real;
.....
stringlist:=tstringlist.Create;
stringlist.Add(A = '++floattostrf(A,ffFixed,10,2));
stringlist.free

it works

var
string_add:string;
.....
stringlist:=tstringlist.Create;
string_add:='A =';
string_add:= string_add +floattostrf(A,ffFixed,10,2);
stringlist.Add(string_add)
stringlist.free;



With Respect

rx3.fireproof

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: Android Module Wizard
« Reply #283 on: February 15, 2015, 04:15:02 pm »
Hi rx3!

Quote
...I can give you the link on the result of me work if you are interested in it....

Yes, I am interested! We can put it as "demo" ....

Ok, I will try fix and implement your suggestions!

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

rx3.fireproof

  • New Member
  • *
  • Posts: 49
Re: Android Module Wizard
« Reply #284 on: February 15, 2015, 05:23:28 pm »
Ok

The result here  https://yadi.sk/d/MozLnxSpeieyu
 

If you need the source for the demo, I will remove the math and will send the source via e-mail (e-mail?)
Code not a professional, I'm not a programmer.
To put or not to put you to decide

With Respect

rx3.fireproof
« Last Edit: February 16, 2015, 11:10:16 pm by rx3.fireproof »

 

TinyPortal © 2005-2018