I made an app with a database of GPS trails. User can choose trails (a .gpx file) from a list and it will be opened with any external GPS app.
Few months ago, due iOs upgrade to ver 11.xx.xx i have to add copy file from DirAssets to DirTemp before invoke OpenFile.
Few days ago a friends of mine showed as on his iPad Air with iOS 11.4.1 the opening file does not works but it works on
iPhone 4 - iOS
iPad 2 - iOS 9.3.5
iPhone 6+ - iOS 11.4.1
iPhone X - iOS 11.4.1
but not on iPad Air 2 with iOS 11.4.1
This is my code
After the user choise i fill a List with data read from a text file with a specific structure to extract more than an information from any line
When user tap a line i will show the gpx file true opening external app
This code works on the above devices but not on iPad Air... (and apple store does not accept any new upgrade of app)
Any suggestions will be apprecciated
Thank you
Sergio
Few months ago, due iOs upgrade to ver 11.xx.xx i have to add copy file from DirAssets to DirTemp before invoke OpenFile.
Few days ago a friends of mine showed as on his iPad Air with iOS 11.4.1 the opening file does not works but it works on
iPhone 4 - iOS
iPad 2 - iOS 9.3.5
iPhone 6+ - iOS 11.4.1
iPhone X - iOS 11.4.1
but not on iPad Air 2 with iOS 11.4.1
This is my code
B4X:
'Code module
#If RELEASE
#CertificateFile: ios_distribution.cer
#ProvisionFile: sentieri.mobileprovision
#End If
#Region Project Attributes
#ApplicationLabel: I Sentieri del Centro Abruzzo
#Version: 1.9.0
#iPhoneOrientations: Portrait
#iPadOrientations: Portrait, PortraitUpsideDown
#Target: iPhone, iPad
#MinVersion: 7
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private main1, princi1, genzana1, maiellamain1, parcomaiella1, parconalm1, sirentevelino1, vallesagittario1, mostra1 As Page
Public di As DocumentInteraction
Public di_page As String
....
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
....
End Sub
After the user choise i fill a List with data read from a text file with a specific structure to extract more than an information from any line
B4X:
Sub ParcoNALM_Click
parconalm1.Initialize("parconalm1")
parconalm1.Title = "I Sentieri del Centro Abruzzo"
parconalm1.RootPanel.LoadLayout("parconalm")
NavControl.ShowPage(parconalm1)
'leggo le tracce
If File.Exists(File.DirAssets,"traccepnalm.txt")=True Then
clv1.Clear
mylist=File.ReadList(File.DirAssets,"traccepnalm.txt")
If mylist.size>1 Then
For i= 0 To mylist.Size-1
line=mylist.Get(i)
dove=line.IndexOf(";")
codice=line.SubString2(0,3)
percorso=line.SubString2(4,dove)
descri=line.SubString(dove+1)
di_page=1
clv1.Add(CreateListItem(percorso, descri, clv1.GetBase.Width, 48dip), 150dip, codice)
Next
pre_percorso="pnalm_"
End If
Else
Msgbox("File delle tracce non trovato","Errore")
End If
End Sub
B4X:
ub clv1_ItemClick (Index As Int, Value As Object)
Dim traccia, nome As String
nome=Value
nome=nome.ToLowerCase
traccia=pre_percorso & nome & ".gpx"
File.Copy(File.DirAssets, traccia, File.DirTemp, traccia)
di.Initialize("di", File.DirTemp,traccia)
Try
If di_page=1 Then
di.OpenFile(parconalm1.RootPanel)
End If
If di_page=2 Then
di.OpenFile(vallesagittario1.RootPanel)
End If
If di_page=3 Then
di.OpenFile(genzana1.RootPanel)
End If
If di_page=4 Then
di.OpenFile(sirentevelino1.RootPanel)
End If
If di_page=5 Then
di.OpenFile(parcomaiella1.RootPanel)
End If
Catch
Msgbox("Non posso aprire il file.", "Errore")
End Try
End Sub
Any suggestions will be apprecciated
Thank you
Sergio