1

I have a magnetic card reader code in android, i want to access this app into a browser (via javascript) or using HTML5 getUserMedia() API to get a swipe from the card and get the card information through JavaScript. Any way to do this? Please share example code, if you have...

Edit: I referred this link: Jquery Mobile Web: Is Calling Native Apps possible?

I don't know how to use this in my script: myapp://myparam

i added this code in my manifest file,

<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:host="http://market.android.com/"
                    android:scheme="http" >
                </data>


            </intent-filter>

how to launch this app in browser(i.e link)...

Community
  • 1
  • 1
Jems
  • 33
  • 1
  • 7
  • What have you tried so far? And I'm not a pro-phonegap but I think you'll have to dev an extension – Jaffa Dec 11 '12 at 09:12
  • i have unimag card reader code(android code) to get card information.But i dont know how to call this into browser using script. – Jems Dec 11 '12 at 09:18
  • 1
    Look at http://stackoverflow.com/questions/525063/android-respond-to-url-in-intent and http://stackoverflow.com/questions/2430045/how-to-register-some-url-namespace-myapp-app-start-for-accessing-your-progr – kketch Dec 11 '12 at 09:40
  • @KKetch +1 You should turn that comment into an answer – Vincent Mimoun-Prat Dec 11 '12 at 11:14
  • @KKetch: Those would allow the OP to start the other app but not get any results back. – CommonsWare Dec 11 '12 at 12:11

1 Answers1

0

i want to access this app into a browser (via javascript) or using HTML5 getUserMedia() API to get a swipe from the card and get the card information through JavaScript. Any way to do this?

Not at the application level. You could start the card reader app via a hyperlink, but you have no way of getting a result back in your JavaScript. As others indicated in the comments, you will need to implement a PhoneGap extension that incorporates your reader code.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • i need to launch and run android app in browser,is this possible? – Jems Dec 11 '12 at 12:46
  • @user1759360: You most certainly can't run a native app "in browser". You cannot even run a native app in another native app. You can *launch* a native app from the browser, having it take over the screen, but this is akin to linking to a third-party Web site -- you lose control and cannot really get anything back. – CommonsWare Dec 11 '12 at 12:55