What is the best way to access hardware on IPAD 2 from a web application?

Discussion in 'iOS Programming' started by DonRobb, Jan 12, 2012.

  1. DonRobb macrumors newbie

    Oct 17, 2011
    Is it possible to start a process on an IPAD 2 from a web application?
    I would like to create platform independent code (possibly using Java Script) and be able to start platform dependent code from withing it. What should I be reasearching to learn how to do this? Is it possible?
  2. ChristianVirtual macrumors 601


    May 10, 2010
    To my undersanding you are not allowed to download binary from Internet; JS you can download in browser but HW only through what apple provide you.
    You find more on developer.apple.com
  3. DonRobb thread starter macrumors newbie

    Oct 17, 2011
    Are you saying that it's not possible? I have written stuff on the IPAD that touches IPAD hardware. I would just like to make calls to it from Java script? Even if I could modify a file or makes calls to a dll or something it would achieve what I want to do. Do you know to where to look on the apple dev to learn how? Or do you think its just not possible?
  4. phantax macrumors member

    Feb 2, 2009
    You won't be able to make native calls through a web application, that would be quite a security nightmare.

    The most you can do is use the web app UI elements to style your application to resemble a native one.
  5. DonRobb thread starter macrumors newbie

    Oct 17, 2011
    I posted the same quesion on stack overflow. This is the answer I got.

    "Not directly no. The web browser is pretty much a sandbox. However another application can register a URL handler and the browser can call out to that URL"

    Do you know where I can find documetation that explains this?
  6. phantax macrumors member

    Feb 2, 2009
    You can find more information on how to do this by searching for Custom URL Schemes.

    Be aware that if you use this approach that users will be taken out of Safari and into the native app.

    The most you can do is pass along some information to the app when it launches, so I am not sure this is actually what you are after.
  7. DonRobb thread starter macrumors newbie

    Oct 17, 2011
    It is true that I would like to get values back and display them in the browser,
    let the user modify them and write them back to the application\hardware. I did seach for the Custom URL scheme. Seems to confirm what your saying about only being able to pass info in to an app when it launches. If there is no way I'll have to live with it. However It is desirable to do common UI code in java script so it only has to be written once for different mobile platforms and do as least as possible that is platform specific, such as reading and writing values. If anyone has further ideas on how this might achieved I would appreciate there comments. Thank for you answer my friend.
  8. robbieduncan Moderator emeritus


    Jul 24, 2002
    What you are describing might be possible by embedding a UIWebView within your application. This could, in effect, be the entire interface if that's what you want. You can call Javascript (to pass values back via function/method calls) via the stringByEvaluatingJavaScriptFromString: method and use the delegate object to capture load requests to allow the JS to interact with the Objective-C.

    I would note this is likely to make your users hate you. My bank has a, so-called, iOS app that uses HTML/javascript for it's entire interface and it does not feel native. It presents a vastly sub-optimal experience. iOS users expect apps to feel like iOS apps. If they (I included) wanted to use a website we'd use a website.
  9. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    What, specifically, in the iPad hardware are you trying to access?
  10. ppilone macrumors 6502

    Jan 20, 2008
    ^ don't get me started on the Netflix "app".

Share This Page