Android Question Problem with file of configuration

Heppy

Active Member
Licensed User
Longtime User
Hi.

He does not read me a text file when he reboots the phone. I give example. I have Android 7.1.1

Don't open layout in startboot
B4X:
Sub LeerIP
    Dim List1 As List
    If File.Exists(File.DirDefaultExternal, "HeppyMPD.txt") = False Then
        List1.Initialize
        List1.Add("192.168.1.17")
        List1.Add("8000")
        File.WriteList(File.DirDefaultExternal, "HeppyMPD.txt", List1)
        MPD.IP="192.168.1.17"
        MPD.Puerto=8000
        EditText1.Text="192.168.1.17"
        EditText2.Text="8000"
    Else
        List1.Initialize
        List1 = File.ReadList(File.DirDefaultExternal, "HeppyMPD.txt")
        MPD.IP=List1.Get(0)
        MPD.Puerto=List1.Get(1)
        EditText1.Text=List1.Get(0)
        EditText2.Text=List1.Get(1)
        Log("Leyendo")
    End If
End Sub

Y el manifest:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.

Thanks
 
Last edited:

udg

Expert
Licensed User
Longtime User
Upvote 0

udg

Expert
Licensed User
Longtime User
Not really.
Ok, my reply was too short but it was because I linked the proper thread where all the infos could be read by the OP.
What do you find wrong with it? Should I had to refer to API23+ instead of 26, B48 and Google new policies?
I am asking because I like to know what it should be the right way to reply, short of "watvh the video". TIA

ps: personally I use GetSafeDirDefaultExternal or DirInternal so I don't experience any problem. At least so far..
 
Upvote 0
Top