- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm new to hybrid app development but I'm familiar with all front end and back end development in web, I faced a little confusion in my first app.
I started a hybrid app project using Intel XDK and I need to set up a registration and login (with remember me feature) for users, are there any APIs that I can use to achieve this or how can I simply implement it using JSON,PHP and MySQL? Should I use php sessions?
I've been searching on google for a simple registration tutorial and had no luck finding any, a little push in the correct path would be great.
Thanks.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cordova apps are "websites", but you have to imagine them like a bridge to your server (if you need any). In this case the simple thing you can do is to setup some REST apis. Then you can manage with them registration, login etc... Usually you need to pass a token to manage authenticated requests. To have a "remember me" feature you can use the local storage feature of modern web browsers (a key value store).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andrea C. wrote:
Cordova apps are "websites", but you have to imagine them like a bridge to your server (if you need any). In this case the simple thing you can do is to setup some REST apis. Then you can manage with them registration, login etc... Usually you need to pass a token to manage authenticated requests. To have a "remember me" feature you can use the local storage feature of modern web browsers (a key value store).
Thank you Andrea for your reply,
I haven't used REST api before, should I develop my own REST api or are there any available apis that I can use?
The app I'm developing is very basic.
I should also mention I do not need any high-end security for the app since I'll be implementing this on a time table app for my college, which shows a logged in user the lectures due today or within the week with time, name of lecture and date, I'm using the registration system to save user preferences such as the students batch name and name of the degree program so that when the user opens the app at any given time, specific timetable of the user will be shown (Please elaborate a bit on "Remember me" feature for loading user preferences like what I mentioned.), is the simplest way to achieve this through using REST or is there any other simple route?
Please do add any tutorials based on REST apis to achieve the user registration/login system, I know how REST works after watching a very informative video but no idea how I can get started (I'm a student and still on learning phase).
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think first you have to answer yourself: do I need an Hybrid App? As far as I understood, you are not going to use some particular features of a phone/tablet (like geolocation, camera and so on). I think you have two choices:
1) Use a real phonegap app, in this case your "website" is the app, and can connect (via REST apis), to a webserver. Or you can use a sqlite adapter that loads the timetable from an existing sql database. The advantage of this method is that everything can be used offline. For rest API tutorial simply search on google, there are a lot of resources available. Usually you have to develop your interface (API). Concerning the remember me feature, you have to store a token (a kind of session id) somewhere, to send it every time to your server. You can use HTML5 features such as localstorage (http://www.w3schools.com/html/html5_webstorage.asp), to store the data you need. I developed my APIs using this Python Framework (http://www.django-rest-framework.org/)
2) Use a an app that is a link to a website (for instance an app that connects automatically to an existing website). In this case you don't have to worry of registration and so on, you can implement *everything* in your external server. The disadvantage of this method that the user must be online every time.
In my opinion you should try to investigate more on what you need and follow some tutorials in order to understand the possibilities (pros and cons) that HTML5 hybrid apps can give you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for helping out, Andrea.
@Ramith -- Andrea is a very accomplished app developer, I recommend you follow his advice. :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul F. (Intel) wrote:
Thanks for helping out, Andrea.
@Ramith -- Andrea is a very accomplished app developer, I recommend you follow his advice. :)
Yeah Paul, Andrea was very helpful :)
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Andrea.
Very interesting your explanation.
I have a very similar problem with Ramith, and saw several articles that teach make a connection by the webserver. However I developed a control system students at a school made the Firebird. I can make an application connecting to Firebird instead of connecting to the MySql for example?
Regards,
Cezar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure you can, it doesn't matter if you use MySQL, Postgres or Firebird.
Usually the flow is
APP --> WEBSERVER REQUEST (REST) -> DB -> WEBSERVER RESPONSE -> APP
so you can use whatever fit your needs for db. As said before you need to write your adapter (REST for instance) to do this job.
Cezar M. wrote:
Dear Andrea.
Very interesting your explanation.
I have a very similar problem with Ramith, and saw several articles that teach make a connection by the webserver. However I developed a control system students at a school made the Firebird. I can make an application connecting to Firebird instead of connecting to the MySql for example?Regards,
Cezar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Andrea.
Thanks again.
Could you tell me where I can find documentation about connecting to Firebird database or database instances of XDK and firebird?
My best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cezar, you need to use RESTful calls (e.t., using AJAX) from within your app to call a server that contains the database. You determine how that should work and what sort of data should go back and forth, not the XDK. If you're accessing some commercial database on a network-accessible server, they might have a RESTful API you can use to get and put data. There's no special database that's part of the XDK (which is a Cordova app). Alternatively, you can use a local database if the data is only to be stored locally in the app, on a per user basis. For that the SQLite database plugin works quite well.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page