Announcement

Collapse
No announcement yet.

How to read file on android?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to read file on android?

    I can't figure out how to read a file from android. The file itself will have a single char either 1 or 0 and it's location is at "sys/devices/13400000.pinctrl/gpio/gpio24/value" Nothing I've tried has worked please I really need a short code example.

    #2
    Hi JLBXB3, try using:
    Code:
    FString data= '''';
    FFileHelper::LoadFileToString(data,*yourPath);
    and set read write permission in the project settings

    Comment


      #3
      however I read your other post about read GPIO Inputs, Unreal Engine AFAIK do not own any way to read GPIO directly, but you can access it by JNI, but first you will need know about UPL system, which allow you modify the GameActivity.java directly and add your own Native function, check this post for JNI and Java mods, https://forums.unrealengine.com/show...Android-Camera and see this example I found for GPIO read through JNI ahttp://android.serverbox.ch/?p=972 and
      http://stackoverflow.com/questions/1...file-using-jni
      Seems relatively simple, but who knows, if I'm wrong somebody correct me
      Last edited by ZkarmaKun; 12-30-2016, 10:00 PM.

      Comment


        #4
        Yeah I'm struggling to grasp this still. If this is easy for you I would be willing to pay some money to save me some time, but I've spent days on this and I'm about to go crazy trying to figure this out haha.

        Comment


          #5
          Yes I want to try, why not, but right now I m on my vacations, I will back in 2 weeks, sorry mate

          but I'm sure over here, somebody can help you

          Comment


            #6
            If you can access this as a file, you can just use fopen("/sys/devices/13400000.pinctrl/gpio/gpio24/value","rb") in C++ on Android to do this.

            Otherwise, you may want to use JNI to talk to the Java interface. I'm thinking this is what you want: https://developer.android.com/things/sdk/pio/gpio.html

            Comment

            Working...
            X