can i open my app from url and pass some strings to the app from the url ?
like
can i do this ?
like
myapp://open.com?str=123
can i do this ?
myapp://open.com?str=123
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="myapp" />
</intent-filter>
)
you opened a browser on your android device or you opened a browser on your pc?but when i type http://myapp in the browser it does not open the app
your manifest does not match the url usedi have added manifest like following
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "myapp://” -->
<data android:scheme="myapp" android:host="*" />
</intent-filter>
)
Sub Activity_Resume
If Activity.GetStartingIntent = lastintent Then Return
Dim In As Intent
In = Activity.GetStartingIntent
lastintent = In
Log("--- Intent")
Log("Action: "&In.Action)
Log("ExtrasToString: "&In.ExtrasToString)
If In.ExtrasToString <> "no extras" Then
ListView1.AddSingleLine(In.ExtrasToString)
ListView1.AddSingleLine("--- Data")
Dim data As String = In.GetData
Dim data As String = In.GetData
If data <> Null Then
If data.StartsWith("myapp://") Then
data = data.SubString(8)
End If
End If
Log("Data:"&data)
'data = data.re Replace("beka:|/|/","")
ListView1.AddSingleLine("data="&data)
If data <> Null Then
Dim method As String = data.SubString2(0,data.IndexOf("/"))
Log($"Methodname: ${method}"$)
ListView1.AddSingleLine($"Methodname: ${method}"$)
Dim values As List
values.Initialize
values = Regex.Split("\/", data)
If values.Size > 0 Then
For i = 0 To values.Size-1
Dim par As String = values.Get(i)
'ListView1.AddSingleLine(values.Get(i))
If par.IndexOf("=") > 0 Then
Dim revalues() As String = Regex.Split("=",par)
ListView1.AddTwoLines("Parameter: "&revalues(0),"Value = "&revalues(1))
End If
Next
End If
End If
If In.ExtrasToString.Contains("no extras") Then
'No Data
End If
End If
End Sub