Question about Launching apps from Web

as4rw

Member
Licensed User
Longtime User
Hi, everyone, I am new to this Basic4Android. I wrote an application and use web to launch it. It works on the emulator 2.33 and Dolphine web browser but not on HTC Evo Webkit web browser [Android Version 2.35]. I am not sure why. Any help is greatly appreciated.

Manifest:

AddManifestText(
<uses-sdk android:minSdkVersion="4" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddActivityText(main,
<intent-filter>
<data android:scheme="my.cameraapp.scheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
)

----------------------------------------
From the web page:

<a href="my.cameraapp.scheme://key1/key2")>
<asp:Label ID="lblink"
runat ="server"
Text ="Launch My Camera-my.cameraapp.scheme:"
Font-Bold ="true"
Font-Size ="18px" />

Thanks.
 
Last edited:
Still not working

Hi, Erel,

Thanks for the reply. I tried to remove both of the 'categories' entries and I also tried to remove one at a time. None of them worked.

On the emulator and Dolphin web browser the code works just fine. On the default browser [Webkit?], it does not work but it does not give an error either. It just flashes and does nothing.

Thanks.

Robert
 
Last edited:
Upvote 0
The log

Thanks, Erel,

This is the log I got from the device but I have no clue what it says. Does this give an clue why it cannot launch the program?

Robert


disableGcForExternalAlloc: false

I/ActivityManager( 121): Starting
activity: Intent {
act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER]
flg=0x10200000
cmp=org.jtb.alogcat/.LogActivity
bnds=[120,410][237,528]
}
from pid 6780
I/[POST_RESELECT]( 6780):
[spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@400ff0f8,-1,0,-1,0)

I/[POST_RESELECT]( 6780): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d6b8,-1,0,-1,0)
W/dalvikvm( 6780):
disableGcForExternalAlloc: false
 
Upvote 0
Sample Page

Thanks, Erel,

I put a test line on the front page now. Thanks for looking into it.

City of Orem
-------------------------------------------------------------------
<a href="mywebapps:\\">
<asp:Label ID="lblink"
runat ="server"
Text ="Camera Test"
Font-Bold ="true" />
</a>
-------------------------------------------------------------------

AddManifestText(
<uses-sdk android:minSdkVersion="4" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission (android.permission.INTERNET)
AddActivityText(main,
<intent-filter>
<data android:scheme="mywebapps" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
)
----------------------------------------------------------------------------

Robert
 
Upvote 0
I've tried it with the default browser and it works correctly (tested on Android 4.1).

Check the unfiltered logs and look for a line such as this:
START {act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=mywebapps:// cmp=aaa.bbb.aaa/.main (has extras) u=0} from pid 10632
This line describes the intent that is being sent.
 
Upvote 0
Thank you very much...

Erel, Thanks for helping me. I have tried and still it is not working. I think that it might be the version of OS [Android Version 2.35]. Although I tried on emulator [version 2.34], it works fine. Maybe it has something to do with HTC. Anyway, thanks a lot. Do not spend any more time on it.

Robert.
 
Upvote 0
Back
Top