Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
klem_johansen
Jul 11, 2002

[be my e-friend]
I'm trying to launch the Nook's "Shop Details" intent through phonegap (1.4.1). I'm new to Android and I'm a little confused. I need to trigger an intent with javascript. The original intent sample clode looks like this:

code:
import android.content.Intent;
Intent i = new Intent();
i.setAction( "com.bn.sdk.shop.details" );
i.putExtra( "product_details_ean" , "12344567890" );
startActivity( i );
I should be able to use WebIntent, but I can't seem to get it to work. It seems to be included with PhoneGap. I can see the source
which appears to be built into PhoneGap. I can include the .js source, anyway. I saw some instructions that told me to add WebIntent.java to the project's /src/borismus folder but that just creates more errors. Am I barking up the wrong tree?

code:
function seeBook(ean){
          var extras = {};
          extras[WebIntent.product_details_ean] = ean;
         window.plugins.webintent.startActivity({
				url:'',
				action: 'com.bn.sdk.shop.details',
				type: 'text/plain', 
				extras: extras 
            }, 
            function() {
                alert("Book link launched.");
            }, 
            function() {
              alert('Failed.');
            }
          ); 
}
It looks like I'm not implementing webIntent correctly. I'm including webintent.js in my main html but I still get errors indicating that startActivity isn't declared even though I can see it right there.

klem_johansen fucked around with this message at 03:06 on Sep 14, 2012

Adbot
ADBOT LOVES YOU

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply