Recent

Author Topic: Android programming  (Read 4231 times)

young_nandy

  • New Member
  • *
  • Posts: 41
Android programming
« on: January 19, 2019, 05:14:28 am »
Hello,

I want to learn Android programming on this lazarus. but I am confused what should be provided because there is no virtual android OS like the embarcadero. can i help me

Is it possible for 'lazarus' to be connected to an Android handphone to create an Android program?

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Android programming
« Reply #1 on: January 19, 2019, 04:05:10 pm »
... there is no virtual android OS like the embarcadero.

Did you mean Android emulator?

If you install Android SDK properly, you should have Android Emulator AVD, see the image below. I don't use it, it runs very slow on my Core2 Quad 4 GB RAM computer. I heard there are many free emulators for PC, which run much faster than the one provided by Google.

I prefer to test my app directly on my mobile phone. You can upload your apk to the phone using an USB cable or using wifi file transfer program. I dare not use USB cable because I ever damaged my mobile phone just because I plugged it to my computer using an USB cable.

Is it possible for 'lazarus' to be connected to an Android handphone to create an Android program?

Not sure. But I usually write and build my Android program using my PC, send the result APK to my phone and test the app directly on my phone.
« Last Edit: January 19, 2019, 04:12:50 pm by Handoko »

young_nandy

  • New Member
  • *
  • Posts: 41
Re: Android programming
« Reply #2 on: January 20, 2019, 03:08:42 am »
yes. I mean an Android emulator.

but I want to use another version to save RAM. I heard that there are other applications that can be used like an Android emulator. I want to know about that and how the connection from Lazarus to the Android emulator application or connection to the mobile phone (Android OS).

I did not have a problem with my cellphone, because my cellphone was granted to do something like this.

I am also confused about what you say "You can upload your phone using an USB cable or using WiFi file transfer program", how to find out the IP address of an Android emulator to upload with WiFi?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Android programming
« Reply #3 on: January 20, 2019, 03:56:22 am »
Google? Android emulator gives aprox. 55.000.000 results. Select one! :D

how to find out the IP address of an Android emulator to upload with WiFi?

An emulator will have the same IP than the PC it's runnign on. If that's the development box then you can't connect through wifi (unless it's emulated and connects as a server), but you'll probably be able to simply "copy" the APK to the  emulated SD card or something similar.
« Last Edit: January 20, 2019, 04:01:32 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Android programming
« Reply #4 on: January 20, 2019, 04:37:24 am »
... how to find out the IP address of an Android emulator to upload with WiFi?

You should install Wifi file transfer first, you can find it using Google Play. The program will tell you how to connect the  Android machine to your PC. It may use http or ftp.

If you use Android AVD, you can push your file to the machine by using ADB push:
https://stackoverflow.com/questions/30434451/how-to-push-files-to-an-emulator-instance-using-android-studio
« Last Edit: January 20, 2019, 04:45:19 am by Handoko »

young_nandy

  • New Member
  • *
  • Posts: 41
Re: Android programming
« Reply #5 on: January 20, 2019, 06:26:20 am »
ok thanks for the information.

I'm still looking for anyone who knows how to directly connect lazarus to an Android handphone?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Android programming
« Reply #6 on: January 20, 2019, 02:01:59 pm »
but I want to use another version to save RAM. I heard that there are other applications that can be used like an Android emulator.
Yes, but they're all basically still emulators, just more polished and therefore eats even more RAM.
I want to know about that and how the connection from Lazarus to the Android emulator application or connection to the mobile phone (Android OS).
Learn to use adb.
I am also confused about what you say "You can upload your phone using an USB cable or using WiFi file transfer program", how to find out the IP address of an Android emulator to upload with WiFi?
No need to, `adb devices` will list some kind of unique id of all devices found, be it an emulator running on the same machine, a phone connected through USB or a tablet connected through Wi-Fi, provided you have installed adb drivers for all respective devices. Use that along the adb command you want to use. To install an APK, use `adb -s <unique id of target device> install <path to apk>`.
I'm still looking for anyone who knows how to directly connect lazarus to an Android handphone?
I don't know any more direct connection than through USB cable.

young_nandy

  • New Member
  • *
  • Posts: 41
Re: Android programming
« Reply #7 on: January 21, 2019, 12:59:25 am »
thanks for the information.

are you sure about this "Yes, but they're all basically still emulators, just more polished and therefore even more RAM." ?

I have found LaztoApk, like it can be used for connections from Lazarus to Android phones.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Android programming
« Reply #8 on: January 21, 2019, 01:27:54 am »
LazToAPK is a tool to help you create Android app in Lazarus, it is not a tool used for connections from Lazarus to Android phones. Maybe you used the wrong word or maybe we misunderstood what you meant.
;D

Actually there are many different ways available in Lazarus to create Android app:
http://forum.lazarus.freepascal.org/index.php/topic,38777.msg264428.html#msg264428

young_nandy

  • New Member
  • *
  • Posts: 41
Re: Android programming
« Reply #9 on: January 21, 2019, 09:55:07 pm »
sorry if I am wrong,,  :D :D :D

I only saw the LaztoApk image, there was an ADB log and there was a "device> USB Connected" section. I think it can be used for Lazarus connection to an Android phone.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Android programming
« Reply #10 on: January 22, 2019, 05:50:48 pm »
Android Debug Bridge (adb) is a command line tool provided by Google to let you sending data and commands between your computer and Android devices:
https://developer.android.com/studio/command-line/adb

LazToAPK does not provide adb. You will have it if you install Android SDK. When you install LazToAPK, it will automatically download and install Android SDK for you.

young_nandy

  • New Member
  • *
  • Posts: 41
Re: Android programming
« Reply #11 on: January 23, 2019, 03:12:28 am »
ok, I get it. thanks for the information.

This means the problem of lazarus connection to an Android cellphone is not finished

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Android programming
« Reply #12 on: January 23, 2019, 04:41:40 am »
It depends on what you meant about the connection or what you want to do.

I managed to create a simple chatting program that allow me to send messages between my Android phone and computer via WiFi of the same network. It works as what I want. I'm planning to improve it further to allow me to connect my mobile phone and remote computer over WAN. It is much more technical, it requires ip forwarding, etc. But I'm not familiar with those thing. But I have an idea that allow me to bypass that technical issue, by using a web space that put between them so they (the phone and computer) can communicate using it.

I also have tested the capability of Lazarus to make Android games. Yes, I managed to do it. Recently, I've purchased my first Arduino + Raspberry learning kit. Now I'm still busy with my job, maybe next month I will have time to explore how to connect between Ardunio/Raspberry, Android phone and computer.

Lazarus has endless possibilities. Some users here use Lazarus to create app and put it on Play Store. Android programming in Lazarus is powerful, you have all the tools you need. Unfortunately the tutorials/documentations are hard to find, we have to search the information from other sources.
« Last Edit: January 23, 2019, 04:48:22 am by Handoko »

 

TinyPortal © 2005-2018