2
30hrs
3y

How to write programs on Android 10 that work with files/directories? Have used a number of JVM-based languages like Groovy, Clojure and Kotlin.

My last try was with Groovy. I ran it under Dcoder which has to be cloud-, based as it supports numerous languages. I gave it permission to access storage but got a file not found error from Java. Copied this excerpt for the file path.

import java.io.File

class Example {

static void main(String[] args) {

new File("/storage/emulated/0/read_file.grvy").eachLine {

line -> println "line : $line";

}

}

}
Do I need root? Do I need to change file permissions using Termux? Why can't I find a way to write simple software on a Motorola Super, 3 GB RAM and 8 cores? I hate using a phone for a computer but a seizure has me in a nursing home with only one usable hand.

Any help is greatly appreciated.

Comments
  • 0
    friend, i respect your tenacity.
    i cant help you with your code, but i sincerely hope you will get well soon.
    not ++ ing your rant bc it seems inappropriate to me
  • 0
    I am not expert in android development, but this case is usual among devs
    It frustrated me once because I do not have any permission to access files in the directories.
    Sorry mate I couldn't answer this, but soon u will definitely find an appropriate answer

    Try questioning on reddit or stackoverflow
  • 0
  • 0
    @24th-Dragon
    Thank you. Am I correct in thinking that the constants which need to be applied go into Android Studio? Trying to avoid cross compilation. My goals are quite modest and I don't know Java except it looks very wordy.
  • 0
    @24th-Dragon Thank you for replying.. The link starts off with two lines added to the "manifest file". This is followed by 65 lines of what has to be Java. Guessing this goes into Android Studio which is not supported on Android. Looks like Catch-22 for native software creation.
Add Comment