Developing on Pinephone
#1
(If I need to move this, please let me know where)

Hi everyone, brand new here, first post.

I've been diving headfirst into the linux world for about a year or two, and I'm not looking back after going the way of everyone else here and realizing how fun and deep the linux world goes. I would like to help develop on the pinephone, at least for expanding my own knowledge. I have an interest in programming, though I wouldn't say I'm well educated yet. I have basic scripting experience, understand a fair bit of the linux ecosystem and command line, and am smart enough to figure out a coding system once I have a project to apply it to. I am experienced in the Debian/ubuntu side of things, and would preferably like to stay in that realm because I just like it. I am extremely interested in helping the linux phone movement progress whether by developing, troubleshooting, cleaning up, or even just getting burritos for the team.

So my questions are: how does one get started in this domain? What are some basic things I need to wrap my head around before diving in? What IDEs and languages are best used to program in the Debian-like environment? When developing for mobile/phosh/pinephone specifically, should I be learning a certain discipline, or just learning the desktop environment since it's all just that anyway?

I'm doing research for myself and trying to be self-sufficient, but no reason not to ask the experts their advice on getting started. Any help would be great.

Thanks
  Reply
#2
If you're using Mobian / Phosh, the Librem 5 development documentation might be a good place to start. That's what I'm using.

https://developer.puri.sm/Librem5/Apps/index.html

They cover everything from setting up a dev environment to basic app examples and publishing. They also talk about GNOME Builder and there are also good tutorials for that online as well.
  Reply
#3
This is beautiful. Thanks a lot bud. Exactly the broad strokes I was looking for.
  Reply
#4
Hey guys!

I am also interested in application development for the PinePhone (Manjaro-arm)

I was thinking about using Glade + libhandy, is there anything else? my development machine is a debian-based linux.

Which programming languages could be used in conjunction ?
last time I did any significant C development was a decade and a half ago, so I would rather not do it in C.


EDIT:
just checked out the link provided by zborgerd, lots of valuable information, thanks man!
I went on and installed the dev env per the instructions. from what I see on Gnome Builder, it is also possible to use JS ? interesting!
  Reply
#5
Apparently, as I found out, linux, and linux kernels are written in C. Not sure if it matters or not, but going forward I've decided to write in C, only because it's close to linux OS, close to the kernel, close to the machine and fast to compile.

Maybe someone with more experience can chime in, but I'd rather write in the language that the host OS is written in. Especially if it's fast and efficient (meaning, less operations to execute) I can imagine that translates to less RAM used and less power consumed to operate... Which is what pinephones desperately need.
  Reply
#6
(01-30-2021, 08:36 PM)mandavel Wrote: Apparently, as I found out, linux, and linux kernels are written in C. Not sure if it matters or not, but going forward I've decided to write in C, only because it's close to linux OS, close to the kernel, close to the machine and fast to compile.

Maybe someone with more experience can chime in, but I'd rather write in the language that the host OS is written in. Especially if it's fast and efficient (meaning, less operations to execute) I can imagine that translates to less RAM used and less power consumed to operate... Which is what pinephones desperately need.

A low level language can give you greater efficiencies in speed and memory usage it is true, but it also makes you deal with a lot of low-level details other languages don't. Writing in the same language as the OS is not really necessary. Plenty of applications are written in lots of different languages.

If you insist you want to go low-level though, another low-level and fast language on par with C is Rust. However Rust is much newer and takes advantage of a lot knowledge gained during the almost 50 years C has been around.

C will also let you (quite easily) make lots of mistakes that can lead to security compromises. Rust makes this harder, but some say it can be somewhat more difficult to learn. Personally, I just think it seems harder because Rust won't let you write certain kinds of bad code that are very easy to accidentally write in C, even for experienced programmers.
  Reply
#7
I'd say that if you have enough experience with C then there are some advantages, but it also comes with the burden of having to manually (and painstakingly) manage everything e.g. memory allocation, garbage collection etc.. by your self.

I guess that with pure C you also don't have the benefits of 3rd party abstractions, so you pretty much have to write most of the stuff from scratch? let me know if I am wrong.



I also thought about this a bit, and I'd rather write code that does not need to be bundled with a ton of bloatware (special dependences) to work, on the other hand my C skills are pretty rusty: then I have red a bit about Vala -  from what I understand Vala gives us the benefits of both worlds: in one hand a high level of abstraction, on the other hand your Vala code is basically being translated into C and compiled as such, without the need for dependences like with the very high-level options.


I want to write efficient code, but on the other hand have the ability to also focus on the UI/UX aspect, since after all it is about developing an application for a mobile device that has a touch screen :-)


What do you guys think?
  Reply
#8
I'd be interested in that point too, Kern. I'm ALL about fast, efficient, no bloat, small footprint, "only what you need," so I guess that's why the idea of C appeals to me.
  Reply
#9
Developing applications in Rust for Gnome is a big reason I bought the PinePhone. I haven't had a chance to try it yet (just got my phone yesterday, switched from the Plasma release to Mobian this morning), but I've been looking at this starter project:

https://github.com/richardanaya/pinephon...rs-starter

I've seen some folks talk about compiling Rust on the phone, which seems unnecessary to me since cross-compiling Rust is pretty straightforward, something I've already done for the RaspberryPi.
  Reply
#10
(02-02-2021, 01:57 PM)signal9 Wrote: Developing applications in Rust for Gnome is a big reason I bought the PinePhone. I haven't had a chance to try it yet (just got my phone yesterday, switched from the Plasma release to Mobian this morning), but I've been looking at this starter project:

https://github.com/richardanaya/pinephon...rs-starter

I've seen some folks talk about compiling Rust on the phone, which seems unnecessary to me since cross-compiling Rust is pretty straightforward, something I've already done for the RaspberryPi.

I feel that compiling directly on the phone is really cool as a feature, very cool that it is possible, but as for real software development it is not the most ideal way to go.

so cross-compiling if possible, might a good idea
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pinephone virtual keyboard aular 4 302 04-10-2024, 03:45 PM
Last Post: aular
  PinePhone Doesn't Boot LED Doesn't Show Any Signs When Charging dorkydev 1 199 04-02-2024, 11:50 AM
Last Post: Kevin Kofler
  PinePhone - boot from microSD laserpyramid 5 470 03-06-2024, 06:37 PM
Last Post: aular
  Are you using the Pinephone as your daily driver? jro 157 108,160 02-18-2024, 11:33 PM
Last Post: aular
  2020 PinePhone Manjaro CE EU for sale, name your price astrojuanlu 7 1,721 02-14-2024, 04:51 PM
Last Post: astrojuanlu
  pinephone is not bootble for the box. ijij 1 575 01-19-2024, 01:29 PM
Last Post: fxc
  Multiple issues with the Pinephone MTXP 12 2,259 12-28-2023, 07:55 AM
Last Post: MTXP
  pinephone repair shop shengchieh 0 475 12-26-2023, 02:42 PM
Last Post: shengchieh
  sudo nano file saving pinephone beta edition CharlesGnarley 4 1,636 12-22-2023, 03:44 PM
Last Post: Kevin Kofler
  Can't get Mobian on PinePhone to recognise USB-C docking bar duncan_bayne 9 6,857 12-04-2023, 02:14 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 2 Guest(s)