Recent

Author Topic: Tutorial - Android & Lazarus for novices like me  (Read 59149 times)

Chronos

  • Full Member
  • ***
  • Posts: 212
    • PascalClassLibrary
Re: Tutorial - Android & Lazarus for novices like me
« Reply #15 on: March 02, 2014, 08:17:11 pm »

Sibylla

  • New Member
  • *
  • Posts: 13
Re: Tutorial - Android & Lazarus for novices like me
« Reply #16 on: April 06, 2014, 09:04:35 pm »
Hi,
I encounter a problem with the Android installation at: http://wiki.freepascal.org/Android_tutorial
All steps are ok until Deployment and the C:\Android\Projects\androidlcl\android\build_debug_apk.bat file. I modify the build_debug_apk.bat with the following paths:

REM Adjust these paths to yours
SET PATH=C:\android\android-sdk\tools;C:\android\android-sdk\build-tools\19.0.3;C:\android\android-sdk\platform-tools\;C:\Program Files (x86)\Java\jdk1.6.0_45\bin
SET APP_NAME=lcltest
SET ANDROID_HOME=C:\android\android-sdk
SET APK_SDK_PLATFORM=C:\android\android-sdk\platforms\android-8
SET APK_PROJECT_PATH=C:\android\projects\androidlcl\android

But when I execute the build_debug_apk.bat file, I get a lcltest-unsigned.apk file with 0 octet length.
The resulting file is the follwing:

symbol  : class ViewGroup
location: class com.pascal.lcltest.LCLActivity.LCL_ListViewAdapter
    @Override public View getView(int position, View convertView, ViewGroup pare
nt)
                                                                  ^
src\com\pascal\lcltest\LCLActivity.java:760: cannot find symbol
symbol  : class View
location: class com.pascal.lcltest.LCLActivity.LCL_ListViewAdapter
    @Override public View getView(int position, View convertView, ViewGroup pare
nt)
                     ^
[loading java\lang\Override.class(java\lang:Override.class)]
[loading java\lang\annotation\Annotation.class(java\lang\annotation:Annotation.c
lass)]
[loading java\lang\SuppressWarnings.class(java\lang:SuppressWarnings.class)]
[loading java\lang\annotation\Target.class(java\lang\annotation:Target.class)]
[loading java\lang\annotation\ElementType.class(java\lang\annotation:ElementType
.class)]
[loading java\lang\annotation\Retention.class(java\lang\annotation:Retention.cla
ss)]
[loading java\lang\annotation\RetentionPolicy.class(java\lang\annotation:Retenti
onPolicy.class)]
[checking com.pascal.lcltest.LCLActivity]
src\com\pascal\lcltest\LCLActivity.java:38: cannot find symbol
symbol  : class View
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
      _lclView = (View) targetView;
                  ^
[loading java\lang\Integer.class(java\lang:Integer.class)]
[loading java\lang\Number.class(java\lang:Number.class)]
src\com\pascal\lcltest\LCLActivity.java:55: cannot find symbol
symbol  : variable Log
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
      Log.v("lclproject", "LCLInputConnection.commitText =" + text + " newCursor
Position=" + Integer.toString(newCursorPosition));
      ^
src\com\pascal\lcltest\LCLActivity.java:52: method does not override or implemen
t a method from a supertype
    @Override public boolean commitText(CharSequence text, int newCursorPosition
)
    ^
src\com\pascal\lcltest\LCLActivity.java:69: cannot find symbol
symbol  : variable Log
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
      Log.v("lclproject", "LCLInputConnection.deleteSurroundingText left=" + Int
eger.toString(leftLength) + " right=" + Integer.toString(rightLength));
      ^
src\com\pascal\lcltest\LCLActivity.java:75: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
        eventResult = LCLOnKey(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL, null,
 (char) 0);
                               ^
src\com\pascal\lcltest\LCLActivity.java:75: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
        eventResult = LCLOnKey(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL, null,
 (char) 0);
                                                     ^
src\com\pascal\lcltest\LCLActivity.java:77: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
        eventResult = LCLOnKey(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL, null, (
char) 0);
                               ^
src\com\pascal\lcltest\LCLActivity.java:77: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
        eventResult = LCLOnKey(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL, null, (
char) 0);
                                                   ^
src\com\pascal\lcltest\LCLActivity.java:91: cannot find symbol
symbol  : variable super
location: class com.pascal.lcltest.LCLActivity.LCLInputConnection
      return super.deleteSurroundingText(leftLength, rightLength);
             ^
src\com\pascal\lcltest\LCLActivity.java:67: method does not override or implemen
t a method from a supertype
    @Override public boolean deleteSurroundingText(int leftLength, int rightLeng
th)
    ^
src\com\pascal\lcltest\LCLActivity.java:106: cannot find symbol
symbol  : method setWillNotDraw(boolean)
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      setWillNotDraw(false);
      ^
src\com\pascal\lcltest\LCLActivity.java:108: cannot find symbol
symbol  : method setWillNotCacheDrawing(boolean)
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      setWillNotCacheDrawing(true);
      ^
src\com\pascal\lcltest\LCLActivity.java:110: cannot find symbol
symbol  : method requestFocus()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      requestFocus();
      ^
src\com\pascal\lcltest\LCLActivity.java:111: cannot find symbol
symbol  : method setFocusableInTouchMode(boolean)
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      setFocusableInTouchMode(true);
      ^
src\com\pascal\lcltest\LCLActivity.java:117: cannot find symbol
symbol  : method getWidth()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      int lWidth = getWidth();
                   ^
src\com\pascal\lcltest\LCLActivity.java:118: cannot find symbol
symbol  : method getHeight()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      int lHeight = getHeight();
                    ^
src\com\pascal\lcltest\LCLActivity.java:136: package Bitmap does not exist
        canvasbitmap = Bitmap.createBitmap(lWidth, lHeight, Bitmap.Config.ARGB_8
888);
                                                                  ^
src\com\pascal\lcltest\LCLActivity.java:136: cannot find symbol
symbol  : variable Bitmap
location: class com.pascal.lcltest.LCLActivity.LCLSurface
        canvasbitmap = Bitmap.createBitmap(lWidth, lHeight, Bitmap.Config.ARGB_8
888);
                       ^
src\com\pascal\lcltest\LCLActivity.java:114: method does not override or impleme
nt a method from a supertype
    @Override protected void onDraw(Canvas canvas)
    ^
src\com\pascal\lcltest\LCLActivity.java:145: cannot find symbol
symbol  : variable super
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      super.onKeyDown(keyCode, event);
      ^
src\com\pascal\lcltest\LCLActivity.java:146: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      int eventResult = LCLOnKey(KeyEvent.ACTION_DOWN, keyCode, event, (char) 0)
;
                                 ^
src\com\pascal\lcltest\LCLActivity.java:142: method does not override or impleme
nt a method from a supertype
    @Override public boolean onKeyDown (int keyCode, KeyEvent event)
    ^
src\com\pascal\lcltest\LCLActivity.java:154: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      int eventResult = LCLOnKey(KeyEvent.ACTION_UP, keyCode, event, event.getUn
icodeChar());
                                 ^
src\com\pascal\lcltest\LCLActivity.java:158: cannot find symbol
symbol  : variable super
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      super.onKeyUp(keyCode, event);
      ^
src\com\pascal\lcltest\LCLActivity.java:162: cannot find symbol
symbol  : method finish()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
        finish();
        ^
src\com\pascal\lcltest\LCLActivity.java:171: cannot find symbol
symbol  : variable KeyEvent
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      if (keyCode == KeyEvent.KEYCODE_MENU)
                     ^
src\com\pascal\lcltest\LCLActivity.java:174: cannot find symbol
symbol  : method closeOptionsMenu()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
        if (flagIsMenuOpen) closeOptionsMenu();
                            ^
src\com\pascal\lcltest\LCLActivity.java:175: cannot find symbol
symbol  : method openOptionsMenu()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
        else openOptionsMenu();
             ^
src\com\pascal\lcltest\LCLActivity.java:151: method does not override or impleme
nt a method from a supertype
    @Override public boolean onKeyUp (int keyCode, KeyEvent event)
    ^
src\com\pascal\lcltest\LCLActivity.java:185: cannot find symbol
symbol  : method postInvalidate()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      if ((eventResult | 1) != 0) postInvalidate();
                                  ^
src\com\pascal\lcltest\LCLActivity.java:182: method does not override or impleme
nt a method from a supertype
    @Override public boolean onTouchEvent (MotionEvent event)
    ^
src\com\pascal\lcltest\LCLActivity.java:193: cannot find symbol
symbol  : variable InputType
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      outAttrs.inputType = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
                           ^
src\com\pascal\lcltest\LCLActivity.java:194: cannot find symbol
symbol  : variable EditorInfo
location: class com.pascal.lcltest.LCLActivity.LCLSurface
      outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE;
                            ^
src\com\pascal\lcltest\LCLActivity.java:189: method does not override or impleme
nt a method from a supertype
    @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs
)
    ^
src\com\pascal\lcltest\LCLActivity.java:198: method does not override or impleme
nt a method from a supertype
    @Override public boolean onCheckIsTextEditor()
    ^
src\com\pascal\lcltest\LCLActivity.java:220: operator != cannot be applied to co
m.pascal.lcltest.LCLActivity.LCLSurface,<nulltype>
    if (((eventResult & 1) != 0) && (lclsurface != null)) lclsurface.postInvalid
ate();
                                                ^
src\com\pascal\lcltest\LCLActivity.java:220: cannot find symbol
symbol  : method postInvalidate()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
    if (((eventResult & 1) != 0) && (lclsurface != null)) lclsurface.postInvalid
ate();
                                                                    ^
src\com\pascal\lcltest\LCLActivity.java:231: cannot find symbol
symbol  : variable super
location: class com.pascal.lcltest.LCLActivity
    super.onCreate(savedInstanceState);
    ^
src\com\pascal\lcltest\LCLActivity.java:234: cannot find symbol
symbol  : method setContentView(com.pascal.lcltest.LCLActivity.LCLSurface)
location: class com.pascal.lcltest.LCLActivity
    setContentView(lclsurface);
    ^
src\com\pascal\lcltest\LCLActivity.java:235: cannot find symbol
symbol  : method postInvalidate()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
    lclsurface.postInvalidate();
              ^
src\com\pascal\lcltest\LCLActivity.java:238: cannot find symbol
symbol  : method getWidth()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
    lclformwidth = lclsurface.getWidth();
                             ^
src\com\pascal\lcltest\LCLActivity.java:239: cannot find symbol
symbol  : method getHeight()
location: class com.pascal.lcltest.LCLActivity.LCLSurface
    lclformheight = lclsurface.getHeight();
                              ^
src\com\pascal\lcltest\LCLActivity.java:242: cannot find symbol
symbol  : class DisplayMetrics
location: class com.pascal.lcltest.LCLActivity
    DisplayMetrics metrics = new DisplayMetrics();
    ^
src\com\pascal\lcltest\LCLActivity.java:242: cannot find symbol
symbol  : class DisplayMetrics
location: class com.pascal.lcltest.LCLActivity
    DisplayMetrics metrics = new DisplayMetrics();
                                 ^
[loading java\util\Collection.class(java\util:Collection.class)]
[loading java\lang\Iterable.class(java\lang:Iterable.class)]
[loading java\util\ArrayList.class(java\util:ArrayList.class)]
[loading java\lang\Exception.class(java\lang:Exception.class)]
[loading java\lang\Throwable.class(java\lang:Throwable.class)]
[loading java\util\AbstractList.class(java\util:AbstractList.class)]
[loading java\util\AbstractCollection.class(java\util:AbstractCollection.class)]

[loading java\lang\Comparable.class(java\lang:Comparable.class)]
[loading java\util\Map$Entry.class(java\util:Map$Entry.class)]
[loading java\util\Set.class(java\util:Set.class)]
[loading java\lang\CloneNotSupportedException.class(java\lang:CloneNotSupportedE
xception.class)]
[loading java\lang\System.class(java\lang:System.class)]
[loading java\lang\UnsatisfiedLinkError.class(java\lang:UnsatisfiedLinkError.cla
ss)]
[loading java\lang\LinkageError.class(java\lang:LinkageError.class)]
[loading java\lang\Error.class(java\lang:Error.class)]
[total 605ms]
Note: src\com\pascal\lcltest\LCLActivity.java uses unchecked or unsafe operation
s.
Note: Recompile with -Xlint:unchecked for details.
100 errors

C:\android\projects\androidlcl\android>REM DX to convert the java bytecode to da
lvik bytecode

C:\android\projects\androidlcl\android>call dx --dex --verbose --output=C:\andro
id\projects\androidlcl\android\bin\classes.dex C:\android\projects\androidlcl\an
droid\bin\classes
no classfiles specified

C:\android\projects\androidlcl\android>REM Now build the unsigned APK

C:\android\projects\androidlcl\android>del C:\android\projects\androidlcl\androi
d\bin\lcltest-unsigned.apk

C:\android\projects\androidlcl\android>call apkbuilder C:\android\projects\andro
idlcl\android\bin\lcltest-unsigned.apk -v -u -z C:\android\projects\androidlcl\a
ndroid\bin\lcltest.ap_ -f C:\android\projects\androidlcl\android\bin\classes.dex


THIS TOOL IS DEPRECATED. See --help for more information.

java.io.FileNotFoundException: C:\android\projects\androidlcl\android\bin\lcltes
t.ap_ does not exist
Impossible de trouver C:\android\projects\androidlcl\android\bin\lcltest-unalign
ed.apk
jarsigner: unable to open jar file: bin\lcltest-unsigned.apk
Unable to open 'bin\lcltest-unaligned.apk' as zip archive
Appuyez sur une touche pour continuer...

Any help is appreciated. Thanks in advance.

kitsaros

  • New Member
  • *
  • Posts: 27
Re: Tutorial - Android & Lazarus for novices like me
« Reply #17 on: April 09, 2014, 01:34:01 am »
Thanks cronos for your time adding it at wiki.
@Sibylla
Your liblclapp.so was 5.073 kb?
You got correctly the LCLDebugKey.keystore ?

Sibylla

  • New Member
  • *
  • Posts: 13
Re: Tutorial - Android & Lazarus for novices like me
« Reply #18 on: April 09, 2014, 08:11:50 pm »
Hi @Kitsaros, My liblclapp.so is 5.072 Ko in the file manager (when I right-click on Properties, I get: 5 193 728 bytes on disk).
I suppose I also got correctly the LCLDebugKey.keystore file (2 Ko according to the file manager ; 4 096 bytes on disk when I right-click on properties).

kitsaros

  • New Member
  • *
  • Posts: 27
Re: Tutorial - Android & Lazarus for novices like me
« Reply #19 on: April 14, 2014, 12:17:33 am »
you are pretty close ! It must be something really easy .
Try recontrolling the paths at build_debug_apk.bat and running it as admin 

Sibylla

  • New Member
  • *
  • Posts: 13
Re: Tutorial - Android & Lazarus for novices like me
« Reply #20 on: April 15, 2014, 08:37:17 pm »
Yes ! One path was erroneous: i changed it to the correct path: build-tools\19.0.3\
and now it works well. Thank you !

kitsaros

  • New Member
  • *
  • Posts: 27
Re: Tutorial - Android & Lazarus for novices like me
« Reply #21 on: May 10, 2014, 08:11:56 pm »
Excellent news !  ;)

nsunny

  • Full Member
  • ***
  • Posts: 116
  • Code is magic
    • LazPlanet
Re: Tutorial - Android & Lazarus for novices like me
« Reply #22 on: July 19, 2014, 10:19:43 am »
I am not a newbie to Delphi or Lazarus but a newbie to Android programming. I guess I have been to used to a 'set and forget about it' type of compiler. In any event, I followed these instructions above explicitly, checked my paths and etc.

I get the following errors;

C:\Android\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.bfd.exe: cannot find crtbegin_so.o
C:\Android\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.bfd.exe: cannot find -ljnigraphics
C:\Android\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.bfd.exe: cannot find -llog
C:\Android\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.bfd.exe: cannot find -lc
C:\Android\laz4android\fpc\2.7.1\bin\i386-win32\arm-linux-androideabi-ld.bfd.exe: cannot find -lc

What in the world are these files that the linker cannot find? Look more like command line arguments, but...

Also, I did not see an option under linking that would allow the strip symbols, (-Xs). Could that be my problem?

Thanks for any help or pointers!

John

I also got similar messeges. But I found a way in the wiki:
http://wiki.freepascal.org/fpcup#Android_ARM_crosscompiler

Copying the files to appropriate places gave me successful compile!
Lazarus TTS Tutorial | LazPlanet
Lazarus 1.8 | FPC 3.0 | Win7/Linux

mirce.vladimirov

  • Full Member
  • ***
  • Posts: 220
Re: Tutorial - Android & Lazarus for novices like me
« Reply #23 on: July 19, 2014, 04:57:02 pm »
Since I am complete newbie to Android I just loved the possibility of creating android applications with lazarus but i keep getting this message :
"Failed to build APK <prv>. Please start the batch-file <c:\laztoapk\proekti\prv\build_debug_apk.bat> manually and analyze the output." .
Here follows the output.

Code: [Select]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Cloneable.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/io/Serializable.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/AbstractMap.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/SimpleAdapter.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/Filterable.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/BaseAdapter.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/ListAdapter.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/Adapter.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/SpinnerAdapter.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/ViewGroup.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Override.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/annotation/Annotation.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/SuppressWarnings.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/annotation/Target.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/annotation/ElementType.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/annotation/Retention.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/annotation/RetentionPolicy.class)]]
[checking com.pascal.prv.LCLActivity]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Error.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/pm/PackageManager.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/pm/PackageManager$NameNotFoundExcepti
on.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/util/AndroidException.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Exception.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Throwable.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/RuntimeException.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/IntentSender.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/IntentSender$SendIntentException.clas
s)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/io/IOException.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/io/FileNotFoundException.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/AutoCloseable.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Integer.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Number.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/util/Log.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/graphics/Bitmap$Config.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/graphics/Rect.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Comparable.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/text/InputType.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/util/DisplayMetrics.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/WindowManager.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/ViewManager.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/Display.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/MenuItem$OnMenuItemClickListener.class)]
]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/graphics/Paint.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/graphics/Paint$FontMetrics.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/graphics/Color.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/DialogInterface.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/DialogInterface$OnClickListener.class
)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/DialogInterface$OnCancelListener.clas
s)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/app/Dialog.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/Collection.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/Iterable.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/inputmethod/InputMethodManager.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/os/IBinder.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/hardware/SensorListener.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/app/PendingIntent.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/BroadcastReceiver.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/content/IntentFilter.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/ArrayList.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/ListView.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/AbstractList.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/AbstractCollection.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/R.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/R$layout.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/R$id.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/AbsListView.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/AdapterView.class)]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/widget/AdapterView$OnItemClickListener.class)
]]
[loading ZipFileIndexFileObject[c:\laztoapk\downloads\android-sdk-windows\platfo
rms\android-14\android.jar(android/view/ViewParent.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/Map$Entry.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/util/Set.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/CloneNotSupportedException.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/System.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/UnsatisfiedLinkError.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/LinkageError.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/StringBuilder.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/AbstractStringBuilder.class)]]
[loading ZipFileIndexFileObject[C:\Program Files\Java\jdk1.7.0_25\lib\ct.sym(MET
A-INF/sym/rt.jar/java/lang/StringBuffer.class)]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$LCLInputConnection.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$LCLSurface.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$1.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$2.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$3.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$LCLRunnable.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$4.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$5.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$6.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$7.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$8.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$LCL_ListViewItem.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity$LCL_ListViewAdapter.class]]
[wrote RegularFileObject[C:\laztoapk\proekti\prv\android\bin\classes\com\pascal\
prv\LCLActivity.class]]
[total 675ms]
Note: C:\laztoapk\proekti\prv\android\src\com\pascal\prv\LCLActivity.java uses u
nchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning

C:\laztoapk\proekti\prv\android>REM pause

C:\laztoapk\proekti\prv\android>REM DX to convert the java bytecode to dalvik by
tecode

C:\laztoapk\proekti\prv\android>call java -Djava.ext.dirs="c:\laztoapk\downloads
\android-sdk-windows"\platform-tools\lib\ -jar "c:\laztoapk\downloads\android-sd
k-windows"\build-tools\18.1.1\lib\dx.jar --dex --verbose --output=C:\laztoapk\pr
oekti\prv\android\bin\classes.dex C:\laztoapk\proekti\prv\android\bin\classes
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$1.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$2.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$3.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$4.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$5.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$6.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$7.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$8.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$LCLInputConnection.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$LCLRunnable.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$LCLSurface.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$LCL_ListViewAdapter.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity$LCL_ListViewItem.class...
processing C:\laztoapk\proekti\prv\android\bin\classes\.\com\pascal\prv\LCLActiv
ity.class...

C:\laztoapk\proekti\prv\android>REM pause

C:\laztoapk\proekti\prv\android>REM It seams that dx calls echo off

C:\laztoapk\proekti\prv\android>REM Now build the unsigned APK

C:\laztoapk\proekti\prv\android>del C:\laztoapk\proekti\prv\android\bin\prv-unsi
gned.apk

C:\laztoapk\proekti\prv\android>call java -classpath "c:\laztoapk\downloads\andr
oid-sdk-windows"\tools\lib\sdklib.jar com.android.sdklib.build.ApkBuilderMain C:
\laztoapk\proekti\prv\android\bin\prv-unsigned.apk -v -u -z C:\laztoapk\proekti\
prv\android\bin\prv.ap_ -f C:\laztoapk\proekti\prv\android\bin\classes.dex

THIS TOOL IS DEPRECATED. See --help for more information.

Packaging prv-unsigned.apk
C:\laztoapk\proekti\prv\android\bin\prv.ap_:
=> lib/armeabi/liblclapp.so
=> AndroidManifest.xml
=> resources.arsc
=> res/drawable-hdpi/icon.png
=> res/drawable-hdpi/lazarus.png
=> res/drawable-ldpi/icon.png
=> res/drawable-ldpi/lazarus.png
=> res/drawable-mdpi/icon.png
=> res/drawable-mdpi/lazarus.png
C:\laztoapk\proekti\prv\android\bin\classes.dex => classes.dex

C:\laztoapk\proekti\prv\android>REM pause

C:\laztoapk\proekti\prv\android>REM Generating on the fly a debug key

C:\laztoapk\proekti\prv\android>REM Signing the APK with a debug key

C:\laztoapk\proekti\prv\android>del C:\laztoapk\proekti\prv\android\bin\prv-unal
igned.apk

C:\laztoapk\proekti\prv\android>jarsigner -verbose -keystore C:\laztoapk\proekti
\prv\android\bin\LCLDebugKey.keystore -sigalg MD5withRSA -digestalg SHA1 -keypas
s test12 -storepass test12 -signedjar C:\laztoapk\proekti\prv\android\bin\prv-un
aligned.apk C:\laztoapk\proekti\prv\android\bin\prv-unsigned.apk LCLDebugKey
   adding: META-INF/MANIFEST.MF
   adding: META-INF/LCLDEBUG.SF
   adding: META-INF/LCLDEBUG.RSA
  signing: lib/armeabi/liblclapp.so
  signing: AndroidManifest.xml
  signing: resources.arsc
  signing: res/drawable-hdpi/icon.png
  signing: res/drawable-hdpi/lazarus.png
  signing: res/drawable-ldpi/icon.png
  signing: res/drawable-ldpi/lazarus.png
  signing: res/drawable-mdpi/icon.png
  signing: res/drawable-mdpi/lazarus.png
  signing: classes.dex

C:\laztoapk\proekti\prv\android>REM Align the final APK package

C:\laztoapk\proekti\prv\android>zipalign -v 4 C:\laztoapk\proekti\prv\android\bi
n\prv-unaligned.apk C:\laztoapk\proekti\prv\android\bin\prv.apk
'zipalign' is not recognized as an internal or external command,
operable program or batch file.

C:\laztoapk\proekti\prv\android>REM call and pause together allow us to see the
results in the end

C:\laztoapk\proekti\prv\android>REM pause

C:\laztoapk\proekti\prv\android>

At the end lines I can see some complains about a thing "zipalign". Could that be the thing and what is it anyway ?


EDIT: I found a file zipalign.exe on a subdir of my SDK instalation dir, "android-sdk-windows\build-tools\19.1.0" so I changed the version of "SDK Build Tool" from 18.0.1 to 19.1.0, see attached picture. And now it works. Whats this 18.0.1 and 19.1.0 thing ? What are these numbers mean ?
« Last Edit: July 19, 2014, 07:07:55 pm by mirce.vladimirov »

GreatDayDan

  • New Member
  • *
  • Posts: 22
  • It's a Great! day!
Re: Tutorial - Android & Lazarus for novices like me
« Reply #24 on: February 11, 2015, 12:07:28 pm »
I have completed the first 5 step using current versions of the packages. (Java 8, Android-SDK r24.o2, NDK r10d, Laz4Android1.1-41139-FPC2.7.1)
But the build.bat does not create lazarus.exe.

Edit the file W:\Android\laz4android\build.bat like this :
SET FPC_BIN_PATH=W:\Android\laz4android
Run build.bat (doubleclick) ->  It will compile & bulid lazarus.

I captured a log of the build steps. I do not see any errors, exceptions or failures except for the final strip commands. Says file not found.

Any ideas on how to get this to work?

Thanks...Dan'l

I have Win8.1.

truetom

  • Jr. Member
  • **
  • Posts: 72
    • http://sourceforge.net/projects/laz4android/
Re: Tutorial - Android & Lazarus for novices like me
« Reply #25 on: February 12, 2015, 09:23:51 am »
I have completed the first 5 step using current versions of the packages. (Java 8, Android-SDK r24.o2, NDK r10d, Laz4Android1.1-41139-FPC2.7.1)
But the build.bat does not create lazarus.exe.

Edit the file W:\Android\laz4android\build.bat like this :
SET FPC_BIN_PATH=W:\Android\laz4android
Run build.bat (doubleclick) ->  It will compile & bulid lazarus.

I captured a log of the build steps. I do not see any errors, exceptions or failures except for the final strip commands. Says file not found.

Any ideas on how to get this to work?

Thanks...Dan'l

I have Win8.1.

Hello ,
I think you can try new laz4android from here:http://sourceforge.net/projects/laz4android/files/?source=navbar
laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

WickedDum

  • Full Member
  • ***
  • Posts: 211
Re: Tutorial - Android & Lazarus for novices like me
« Reply #26 on: February 12, 2015, 08:46:07 pm »
All of this info is GREAT!  But...I am traveling with my SAMSUNG Note 10.1.  Android 4.4.2.  Any tutorials for using Lazarus on Android?  Tx!
Practice Safe Computing!!

Intel i5-4460K @ 3.2GHz | Win8.1 64-bit | FPC: v3.0 | Lazarus:  v1.6.0

alireza.2

  • Newbie
  • Posts: 1
Re: Tutorial - Android & Lazarus for novices like me
« Reply #27 on: April 25, 2015, 07:56:45 pm »
Hello dear Community,

I need your Help, I had done everything that is written in the Tutorial, but I get this Error:
Quote
Messages, Warnings: 1
Warning: other sources path of package "lnetbase 0.6.5" contains directory "..\lib", which is already in the unit search path.
Compile package lnetvisual 0.6.5: Exit code 1, Errors: 6
lclnet.pas(45,15) Error: Forward declaration not solved "HandleIgnoreError(TLHandle);"
lclnet.pas(46,15) Error: Forward declaration not solved "HandleIgnoreWrite(TLHandle);"
lclnet.pas(47,15) Error: Forward declaration not solved "HandleIgnoreRead(TLHandle);"
lclnet.pas(48,15) Error: Forward declaration not solved "InternalUnplugHandle(TLHandle);"
lclnet.pas(50,15) Error: Forward declaration not solved "HandleEvents(LongInt;LongWord);"
lclnet.pas(58,14) Error: Forward declaration not solved "AddHandle(TLHandle):Boolean;"


I hope you can help me.

Thank You.
« Last Edit: April 25, 2015, 08:30:40 pm by alireza.2 »

magleft

  • New Member
  • *
  • Posts: 31
Re: Tutorial - Android & Lazarus for novices like me
« Reply #28 on: June 26, 2015, 07:03:30 pm »
Hello to All.

Perhaps my question is dumb or off-topic.

I have made an application that uses a sqlite database .
Now I want to convert the application on android and consider using laz4android.

In the past I tried laz4andoid but I was hard and in the end was not able to connect to the database.

I would like to ask what database I could use so I my application to "run" in android and communicate with the data using my existing application

Thanks in advance
any assistance granted
Version #: 1.8.4
FPC Version: 3.0.4
windows 10
i386-win32-win32/win64

rx3.fireproof

  • New Member
  • *
  • Posts: 49
Re: Tutorial - Android & Lazarus for novices like me
« Reply #29 on: June 26, 2015, 08:14:48 pm »
@magleft

With the Android Module Wizard  it's easy.
Previously posted a link to a demo of my program with the database. (windows to android).
Can put more. There are bugs, but the program works.
In the full version of another code. Fix Demo will not.
I have a new version of java 1.8.45. The paths to fix don't want to.
Customdraw I did not like, not functionally. ( I was able to do only "Hello word" with Android 8. :D
But I'm not a programmer. I don't know much.

With Respect

rx3.fireproof
« Last Edit: June 26, 2015, 08:41:12 pm by rx3.fireproof »