[android-developers] Re: How to launch the app from the Web page?

2010-09-12 Thread ls02
So, that's the link in the Web page to launch your app?

On Sep 12, 6:14 am, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Sep 11, 2010 at 9:46 PM, ls02 agal...@audible.com wrote:
  I added to the manifest file for the activity to be launched:

  intent-filter
  action android:name=android.intent.action.VIEW/action
  category android:name=android.intent.category.DEFAULT/category
  category android:name=android.intent.category.BROWSABLE/category
  data android:scheme=my_scheme/
  /intent-filter

  I load the link in WebView:

  mWebView.loadData(a href=\my_scheme://launch_my_app/refresh_all
  \Launch App/a, text/html, utf-8);

  When I click on the link I get the error -10 The protocol is not
  supported in My WebViewClient.OnReceivedError override.

 See this sample project for some ways to launch an activity from a
 link in a Web page:

 http://github.com/commonsguy/cw-advandroid/tree/master/Introspection/...

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training...At Your Office:http://commonsware.com/training- Hide 
 quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to launch the app from the Web page?

2010-09-12 Thread ls02
I am not sure I understand. My app can be launched both by a Web page
in embedded WebView and the same Web page in a separate Browser app.
If I cannot use custom scheme, I a mfine using standard http or other
scheme.

Can you tell me please what the link is in the Web page that launches
my app?

On Sep 12, 2:35 am, Dianne Hackborn hack...@android.com wrote:
 Please don't use a scheme unless it is one that you have registered.
  Schemes are global to the universe, and since you will be putting this out
 in the universe via your web page you want to follow the rules for them.

 Another approach you can take is to just create an Intent that you want to
 have launched, and print the result of Intent.toUri() to get the string to
 use in your link.  (This should be an intent: URI.)  Then you probably want
 to just make your own action following the standard naming conventions which
 that Intent will use.  You can even use Intent.setPackage() to make sure
 that only your app can be launched from the link, if you want.  (Do note you
 can't use Intent.setComponent() for this for security reasons.)





 On Sat, Sep 11, 2010 at 6:46 PM, ls02 agal...@audible.com wrote:
  I added to the manifest file for the activity to be launched:

  intent-filter
  action android:name=android.intent.action.VIEW/action
  category android:name=android.intent.category.DEFAULT/category
  category android:name=android.intent.category.BROWSABLE/category
  data android:scheme=my_scheme/
  /intent-filter

  I load the link in WebView:

  mWebView.loadData(a href=\my_scheme://launch_my_app/refresh_all
  \Launch App/a, text/html, utf-8);

  When I click on the link I get the error -10 The protocol is not
  supported in My WebViewClient.OnReceivedError override.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubs­cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: How to launch the app from the Web page?

2010-09-12 Thread Mark Murphy
On Sun, Sep 12, 2010 at 8:49 AM, ls02 agal...@audible.com wrote:
 So, that's the link in the Web page to launch your app?

No, that's a link to a GitHub project, demonstrating an application
that responds to a few different link structures. The corresponding
Web page -- referenced in the code -- is:

http://commonsware.com/sample

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to launch the app from the Web page?

2010-09-12 Thread ls02
Launching via intent by some reason does not work: I see in LogCat

09-12 12:28:00.908: INFO/ActivityManager(1100): Starting activity:
Intent { act=android.intent.action.VIEW
cat=[android.intent.category.BROWSABLE]
dat=intent:#Intent;action=com.my_company.my_application.ACTION_LAUNCH_APP;end
(has extras) }

I do not see the name of the activity it tries to launch.

But Web brwoser shows Web page not available and nothing is
launched.

Launching via link does not work inside the WebView. I get the error
URL not found error. Launching via link in stand alone Web browser
works but displays a dialog complete via MyApp or WebBrowser. Is
there way to suppress this dialog?

On Sep 12, 8:51 am, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Sep 12, 2010 at 8:49 AM, ls02 agal...@audible.com wrote:
  So, that's the link in the Web page to launch your app?

 No, that's a link to a GitHub project, demonstrating an application
 that responds to a few different link structures. The corresponding
 Web page -- referenced in the code -- is:

 http://commonsware.com/sample

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training...At Your Office:http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en