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
  eSIM on PinePhone just_a_q 8 4,626 11-05-2024, 11:10 AM
Last Post: zetabeta
  Want to buy second hand PinePhone 3G version rudi.timmermans 0 163 11-01-2024, 09:58 AM
Last Post: rudi.timmermans
  Can use PlayStation on Pinephone? willharper 6 5,650 10-30-2024, 08:07 AM
Last Post: biketool
  Ordered PinePhone till today have no info or confirmation about order hennadiyt 1 344 10-05-2024, 02:20 PM
Last Post: KC9UDX
  US Mobile, via T-Mobile, won't support Pinephone Pro - SOLVED, SIMPLY jovval 11 5,746 07-28-2024, 03:42 PM
Last Post: dchang0
  How can I record video on a Pinephone? kk22 18 7,107 07-22-2024, 05:18 PM
Last Post: baptx
  Pinephone not booting, always vibrating alexander12 8 6,858 07-19-2024, 07:50 PM
Last Post: Blackheart
  PinePhone Pro P. Siera 2 814 07-17-2024, 12:41 AM
Last Post: P. Siera
  PinePhone Boots but only Shows Black Screen with Backlight danyeaw 1 673 06-30-2024, 10:18 AM
Last Post: danyeaw
  Pinephone won't boot. spha 13 5,865 05-15-2024, 10:31 PM
Last Post: Richy_T

Forum Jump:


Users browsing this thread: 1 Guest(s)