this post was submitted on 21 Nov 2024
16 points (100.0% liked)

Programming

265 readers
1 users here now

Welcome to the Lemmygrad programming community! This is a space where programmers of all levels can discuss programming, ask for help with problems, and share their personal programming projects with others.


Rules

  1. Respect all users, regardless of their level of knowledge in programming. We're here to learn and help each other improve.
  2. Keep posts relevant to programming and related topics.
  3. Respect people's personal preferences. If you disagree with someone's choice of programming language, method of formatting code, or anything else, don't attack the poster. Genuine criticism is fine, but personal attacks are not.
  4. In order to promote breaks from typing, all code snippets must be photos of code written on paper.
    Just kidding :), please use proper markdown code blocks.

founded 2 years ago
MODERATORS
 

Looking for tips, tricks, and experiences of comrades who've developed Android apps using Vim, Neovim, or other text editors rather than Android Studio.

It's been a while since I did any Android development but I want to develop an app for personal use. Between then and now I've been using Neovim for everything so I'm loathe to go back to Android Studio but it handles a lot of boiler plate for new projects.

Has anyone got any thoughts or tools to share? I'm very comfortable in the CLI so my dream setup would be using Neovim as a code editor and running build commands etc in a terminal nearby.

top 12 comments
sorted by: hot top controversial new old
[–] bobs_guns@lemmygrad.ml 7 points 5 months ago

I'd rather use Ideavim in Android Studio.

[–] bennieandthez@lemmygrad.ml 5 points 5 months ago

I don't do android development but i do some basic rust stuff, i will share some of the plugins i use when im back home.

Something that comes to mind is using COQ snippets for boilerplate code, or maybe autocommands?

[–] muad_dibber@lemmygrad.ml 5 points 5 months ago (1 children)

I've tried and failed at it, many times. You pretty much have no choice but to use android studio. There is a vim plugin for it at least.

[–] redmagpie@lemmygrad.ml 2 points 5 months ago* (last edited 5 months ago) (1 children)

Ah that sucks to hear :-( I didn't know there was even a plugin ecosystem to Android Studio but of course there is.

I might just use Android studio to set up the project and then do my actual keyboard-bashing in Neovim later. All I really want is the boilerplate set up properly and my app will be a single activity with maybe 3 views, so once that's all generated I'll try switching.

Out of interest, what has been the failure points for you trying this in the past?

[–] muad_dibber@lemmygrad.ml 2 points 4 months ago (1 children)

Oops, sry missed this one. jdtls , the java language server that works with vim / neovim / helix, and the kotlin-language-server don't work with android libraries.

[–] redmagpie@lemmygrad.ml 2 points 4 months ago

No worries re long replies. That's really interesting. I've never used any LSP features before (I am definitely out of touch though) so perhaps this wouldn't be such a blocker.

[–] nephs@lemmygrad.ml 3 points 5 months ago (1 children)

Have you worked with entr?

It generalises watch modes. I can see a setup with tmux and entr to kick-start builds in watch mode, and whatever your neovim stuff is.

[–] redmagpie@lemmygrad.ml 2 points 5 months ago

Thanks comrade, I've never worked with entr but it looks really cool! Thanks for the share.

I doubt I'd need the constant builds on this project but it's going into my list of tools to keep in the back pocket.

[–] lorty@lemmygrad.ml 2 points 5 months ago (1 children)

I'm not sure what your project's requirements are, but it would probably be easier to make an app with React-native or flutter or some other multiplatform since you can spin an app very fast and iterate over it without actually needing any android studio tools (other than the emulator, if you want it) after the initial setup.

[–] redmagpie@lemmygrad.ml 2 points 5 months ago

Thanks for reply comrade. I'm not really a Javascript person, but it's good to know there are alternatives to use for building apps quickly. The last time I used Javascript for anything was jQuery on a website in 2017 and even I think it was outdated in favour of all the fancy frameworks. I haven't the head for keeping up with it al.

I also got burned by multiplatform frameworks back during my undergrad during a group project when the self-elected team lead — a proper bourgie moneyed type who went to like Stow or something — forced us to use Titanium to build an android app when the rest of us wanted to write it in native Android Java. It was godawful, and then when I later came to developing apps I had a pleasant enough time writing in Java.

[–] GreatSquare@lemmygrad.ml 1 points 5 months ago (1 children)

For personal use, Github can automatically build and test your project using Github Actions. You get 2000 minutes / month free.

[–] redmagpie@lemmygrad.ml 1 points 5 months ago

Cheers for the reply comrade.

Since this is just a personal project I'll be installing the app just on my phone via USB and adb, and don't need a proper CI/CD build system. I just need to compile on my machine and stick the apk file onto my phone.