Buiding apps for pinephone
#1
Hi,
How easy is it to build apps for the pine phone.

I am currently building apps for android phones and find this process quite frustrating at times. Given that the pine phone essentially runs a conventional Linux distribution, can apps be built using languages such as python directly? Is there a preferred language for building apps? Or is an SDK required?

Also,
Can lightweight Linux distributions such as MXLinux be adapted to run on the pine phone.

Any help is much appreciated.

Cheers.
  Reply
#2
(05-25-2021, 10:08 PM)katesfb Wrote: I am currently building apps for android phones and find this process quite frustrating at times. Given that the pine phone essentially runs a conventional Linux distribution, can apps be built using languages such as python directly? Is there a preferred language for building apps? Or is an SDK required?

Any help is much appreciated.

I've coded a couple of apps in python+gtk for debian+phosh but haven't done much more beyond proof of concept. What is it you want to know?
  Reply
#3
Hi,
And thanks for the reply.

It was just a general query really. Is writing apps for the pine phone similar to writing apps for a standard linux PC?

For example if a i write an app for use on a linux machine i would use say Geany or Idle if using python (with kivy), and processing IDE which can be used for java, python, javascript.

What is access to the phone sensors like from a programming perspective? For example if i wished to write an app that reported information coming from the light sensor, acccelerometer, magnetometer etc. Is this doable using standard programming tools with maybe a few libraries/methods to interface with the sensors?

Any hep is much appreciated.

Cheers.
  Reply
#4
Programming for the PinePhone is just like programming for a typical x86/x64 linux PC except that you have a tiny touch screen, have to use a screen keyboard, you are on ARM64 instead of x86/x64, and the CPU and GPU are puny compared to modern x86/x64 machines.

You can write programs in python. In fact a lot of programs on the PinePhone are written in python for better (faster to get something up and running) or worse (python isn't known for good performance on desktops, so it can struggle a bit on the PinePhone).

If you write programs from an x86/x64 computer in languages that require compilation, you will need to take care to do cross-compilation or you can do the compilation on the PinePhone itself. It is straightforward to install all the compilers in the package databases of each linux distribution and use them. They will take longer to compile, but they will do the job just as good as on a more powerful machine just slower.

You will need to be a bit more mindful of performance and definitely RAM usage than you would on a x86/x64 desktop or laptop of today. If you have done programming for the Raspberry Pi, then your experience with those issues there will carry over here. The PinePhone has more RAM than the Raspberry Pi 3 and earlier and a comparable processor.

As far as sensors, it depends on which sensor you want to access. The IMU and a few other sensors are accessible via the IIO (Industrial Input Output) subsystem of the kernel (use libiio and tools to access). You can also see the devices in /sys as well. One thing to keep in mind, recent PinePhones use a different magnetometer due to pandemic related component shortages.
  Reply
#5
https://imgur.com/a/n44dZsL

Building apps on the PinePhone is a blessing compared to iOS/Android/WP.

You can code on your linux device, rsync the binary over to the pinephone, use SSH with X Forwarding to run the application on the phone but get the actual Window back to your workstation. I can do that without even having to connect my pinephone to my laptop with a cable, i can just rsync and x-forward over wifi, 4g or even fucking bluetooth if i had to.

It feels exactly like writing desktop applications. There's no emulators or special SDKs, everything just works as you'd expect.
  Reply
#6
(05-26-2021, 11:21 PM)katesfb Wrote: What is access to the phone sensors like from a programming perspective? For example if i wished to write an app that reported information coming from the light sensor, acccelerometer, magnetometer etc. Is this doable using standard programming tools with maybe a few libraries/methods  to interface with the sensors?

I'm yet to mess with sensors, because there you have to deal with them like a PC rather than a SDK etc
  Reply
#7
Hi all,
And thanks for all the replies - very helpful.

I am now even more convinced that this is the way to go. So i will be buying a pine phone and look forward to writing apps for it. Maybe Pine64 should partner with a Chinese hardware supplier company.

Thanks for your comments. much appreciated.

Cheers.

(06-10-2021, 10:52 PM)katesfb Wrote: Hi all,
And thanks for all the replies - very helpful.

I am now even more convinced that this is the way to go. So i will be buying a pine phone and look forward to writing apps for it. Maybe Pine64 should partner with a Chinese hardware supplier company.

Also, do i assume based on previous comments that kivy (python module) will work?

Thanks for your comments. much appreciated. 

Cheers.
  Reply
#8
As someone who is interested on the long-term in mobile app applications, but normally does not code, I became first interested in Matlab. But Matlab is not very suitable for mobile applications. You can use Octave instead for Matlab code which already exists. I doubt if I ever will develop Android apps, but I can image to review and debug Python code. As I said, I usually don t code, but I am convinced to find frends among programmers, since I make my contributions as an author:

https://github.com/PeterGamma

I gave up Matlab. Matlab home is 200 USD but cannot be used for publishing. And Matlab standard which is 2000 USD for mobile applications with terrible devices? Home Assistant has already support for some physiological sensors and has an image for Rasperri Pi, which eventually can be ported to a Linux phone. My only concern with Linux phones is battery life, since physiological data acquisitions needs to run 24 * 7. But I suppose a big battery will do the job.
  Reply
#9
(05-29-2021, 01:51 AM)Trbl Wrote: https://imgur.com/a/n44dZsL

Building apps on the PinePhone is a blessing compared to iOS/Android/WP.

You can code on your linux device, rsync the binary over to the pinephone, use SSH with X Forwarding to run the application on the phone but get the actual Window back to your workstation. I can do that without even having to connect my pinephone to my laptop with a cable, i can just rsync and x-forward over wifi, 4g or even fucking bluetooth if i had to.

It feels exactly like writing desktop applications. There's no emulators or special SDKs, everything just works as you'd expect.


When you say, "rsync the binary over to the pinephone" that means you are compiling it somewhere else and if so then where and how?

Or are you compiling your code on the pinephone64?



I compiled hello world on my Raspberry Pi4 but the binary didnt work on the Pinephone64 so if you can include that in your explanation that would be great too.



For additional context, I code in self-defense to get stuff done repeatedly sort of correct the second time around in a DevOps-ish way - so there is that. 
I do have VScode install on my Pi and thinking if can ssh to the Pine64 to also code on it.



Thanks.
  Reply
#10
I'm using Qt QML and C++ to develop Cross-Compile between PC(Linux) and PinePhone(Mobian, Manjaro ARM).

Setting up an environment for Cross-Compiling development with Qt, can be done in the same way as with Raspberry Pi.
Note that, PinePhone is an "AArch64" architecture. For example, Raspberry Pi 3B is "ARM32 GNU EABIHF".

I have published instructions for building a Qt Cross-Compilation development environment for the PinePhone on my Github.

Qt 5 : https://github.com/presire/How_to_create..._PinePhone
Qt 6 : https://github.com/presire/Qt6_CrossComp..._PinePhone


Additionally, I'm also publishing instructions on how to build a GCC toolchain to Cross-Compile.
How to make GCC Toolchain : https://github.com/presire/How_to_create..._PinePhone


If building a GCC tool chain is too cumbersome, you can also use Linaro's GCC Toolchain.
https://snapshots.linaro.org/gnu-toolchain/

Manjaro ARM (Latest) : https://snapshots.linaro.org/gnu-toolchain/13.0-2022.11-1/aarch64-linux-gnu/
Mobian Bookworm : https://snapshots.linaro.org/gnu-toolcha...linux-gnu/
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  eSIM on PinePhone just_a_q 8 4,697 11-05-2024, 11:10 AM
Last Post: zetabeta
  Want to buy second hand PinePhone 3G version rudi.timmermans 0 179 11-01-2024, 09:58 AM
Last Post: rudi.timmermans
  Can use PlayStation on Pinephone? willharper 6 5,684 10-30-2024, 08:07 AM
Last Post: biketool
  Ordered PinePhone till today have no info or confirmation about order hennadiyt 1 367 10-05-2024, 02:20 PM
Last Post: KC9UDX
  US Mobile, via T-Mobile, won't support Pinephone Pro - SOLVED, SIMPLY jovval 11 5,769 07-28-2024, 03:42 PM
Last Post: dchang0
  How can I record video on a Pinephone? kk22 18 7,219 07-22-2024, 05:18 PM
Last Post: baptx
  Pinephone not booting, always vibrating alexander12 8 6,888 07-19-2024, 07:50 PM
Last Post: Blackheart
  PinePhone Pro P. Siera 2 829 07-17-2024, 12:41 AM
Last Post: P. Siera
  PinePhone Boots but only Shows Black Screen with Backlight danyeaw 1 691 06-30-2024, 10:18 AM
Last Post: danyeaw
  Pinephone won't boot. spha 13 5,906 05-15-2024, 10:31 PM
Last Post: Richy_T

Forum Jump:


Users browsing this thread: 1 Guest(s)