Page 1 of 1

can app tell if it is running as html5 (web) app or a native device app?

Posted: Sat Feb 08, 2014 8:16 pm
by Jamie Robe

Hi, I am totally new here and am trying to plan out the best way to implement my app. I already have a working system as a traditional php generated web application, but with no REST api or anything fancy. It is slow and not very responsive. So I plan on redoing it in Appery :-)

Q1- I need to have a version that runs in any device or PC browser, but I also want essentialy the same functionality in device app version. The device version will have one additional thing to it, a QRcode scanner. Obviously, the camera is only available to native device apps. My question is, can I use the same app project, but in the code detect if it is running as html5 web app abd so turn off the button that activates the qrcode scanner? If not, can I atleast change the warning message that triggers if thenative camera is attempted from a web app, telling people how to get the device app?

Q2- Can an app have different default page, for the logged in and not logged in condition. Much of my system is public, in that no membership is required to use it. However, I do need an optional membership only menu and pages. On my php version now, I actually have two separate apps, which is kinda a pain to keep un-to-date. Have one appery app, which would work both ways would be great.

Q3- are there examples anywhere of how to create simple REST php codefor the server? Then I could just write those and use my own backed right? Otherwise I will need to create new database and code in javascript on appery right?

Q4 - are appery web apps responsive to changes in device or browser widths? 80% of my users are coming thru phones, 5% tablets, 15% on PCs.

Q5- If I have to do things myself in appery server code, can I send emails out from the server side? currently, my php system does emails on the server of my host. If i can't do it in javascript server coding, then would I call something like email sending from my server code to my external php code on the servers I am on now? in other words, would REST be used from js server code to php server code?

Q6- i see how to export html5 client apps for upload to an external website server, in case I need to do that, BUT what about porting the js server code? Is that possible! like to run in my own node.js instance outside of appery?

In summary, your system looks like it meets most, if not all my criteria. If you can help me understand my 6 questions above, I will start up a test asap. The only thing that I am weakest on is the js programming, being 99% php and 1% js now... but I can try :-)

Thanks and peace,
Jamie


can app tell if it is running as html5 (web) app or a native device app?

Posted: Sat Feb 08, 2014 11:21 pm
by Illya Stepanov

Hi Jamie --

On your main question - in Appery.io you always starting with HTML mobile app, and it can be accessible with any device and web browser. But to check and detect from within it the native device features is impossible.

The one of the approaches would be here:

  • if you are already have an web app then you can add links to your new native app that will have Camera and QR-code reader inside it.

    We'll need some time to reply on your other questions.


can app tell if it is running as html5 (web) app or a native device app?

Posted: Mon Feb 10, 2014 9:15 am
by Maryna Brodina

Hello!
[quote:] can I use the same app project, but in the code detect if it is running as html5 web app[/quote]yes, in JS you can check if cordova object is available preif (typeof cordova == "undefined") {
//it's html5
} else {
//it's hybrid
}/pre[quote:]Can an app have different default page, for the logged in and not logged in condition[/quote]yes, using JS check if user is logged in and redirect where you need[quote:]examples anywhere of how to create simple REST php code for the server[/quote]on request server should return information as JSON or XML[quote:]are appery web apps responsive to changes in device or browser widths[/quote]most of elements change size automatically, if you need more complex logic you would need to use custom CSS/JS[quote:]would REST be used from js server code to php server code[/quote]you can call code on your server from app or server code.
On server code there is no node.js and you can't export Appery.io server code and run in it somewhere. In fact you don't need it because you have your own server and you can implement there amy REST API you need.


can app tell if it is running as html5 (web) app or a native device app?

Posted: Mon Feb 10, 2014 2:20 pm
by Jamie Robe

Thank you both IIIyz and Maryna,
I think that gives me a starting place to move forward. I think my strategy will be to get a free account, build a rather simple app using the appery backend, and then try to connect with REST to my current DB. If all goes well, I will then get a paid account as I have multiple app projects going forward.

FYI I spent hours this weekend reading thru all sorts of forum posts here, plus reading thru documentation you have on your site. It all looks pretty comprehensive - good job!

I do have a few additional questions:
Q1 - I use Zooz as my payment system on my current web apps. If I create my apps on yours system, I guess I access Zooz as REST also? I only see a few posts about Zooz users.

Q2 - It would seem like Zooz or other payment systems would be a natural for you guys to wrap in a appery plugin? What do plugins do for people rather than just accessing the REST directly? Do you have any Zooz sample code or anything that could help me?

I am signed up for the webinar this week as well. Thank you for your patience and help.
Peace,
Jamie


can app tell if it is running as html5 (web) app or a native device app?

Posted: Mon Feb 10, 2014 3:02 pm
by Maryna Brodina

[quote:]I use Zooz as my payment system on my current web apps. If I create my apps on yours system, I guess I access Zooz as REST also? I only see a few posts about Zooz users.[/quote] yes, you can access Zooz via REST API
[quote:]It would seem like Zooz or other payment systems would be a natural for you guys to wrap in a appery plugin? What do plugins do for people rather than just accessing the REST directly? Do you have any Zooz sample code or anything that could help me?
[/quote] unfortunatelly we don't have any example.