IOS Web Service Recommendations - php

I have a MYSQL server setup. What are my option for developing a IOS web server that will allow me to do CRUD with the IOS devices.
Please help it will greatly be appreciated. This my first stackoverflow post, being getting recommendations to join this site..

I would recommend an Apache2/PHP/MySQL stack for developing a web service for use with an iOS application. Consider using one of the common PHP frameworks such as codeIgnitor or cakePHP and sending your output in JSON format (not SOAP -- too much overhead).

PHP with a framework (as mentioned by Casey) and Ruby on Rails are probably the two most common solutions -- lots of resources for both here on SO

RobyOnRails absolutely! Because you can use RESTful web services with ease, and there is great RESTKit objective-c framework for object-mapping and abstract layer for network requests.

Though I haven't used this, I'm fan of http://getfrapi.com/ it is right tool for the job.

Related

Xamarin.Forms/Auth - Mobile Application , What kind of Server API is recommended?

I'm just wondering if there are any good / more reliable framework for server side using Xamarin Forms & Xamarin.Auth.
I was planning to use REST and maybe Lumen , which is a php micro framework but i'm not sure how compatible it is with Xamarin.Auth etc...
Tried to google it but interestingly , came up with nothing .
I basically want to register/sign in users from the app to the server , save their info and make REST api requests based on them.
I'm wondering if anyone had any experience with lumen & xamarin or if there are other better choices that are more compatible .
I've been researching different sites and forums for a proper back-end architecture for my cross-platform app. It's a turned-based game using Xamarin with a dedicated webserver and PHP serving as the application layer.
I recommend checking out this post which has a lot of responses from seasoned pros, be sure to scroll down the thread:
http://forums.xamarin.com/discussion/24549/php-mysql-with-json-and-webrequest
Your approach using REST is solid and appears to be the industry standard for mobile devices to access some type of database. Lumen looks promising given it's a framework designed for building APIs on PHP. OAuth2 is supported on Lumen which is supported by Xamarin.Auth. +1
Here's some good food for the brain:
https://esbenp.github.io/2015/05/26/lumen-web-api-oauth-2-authentication/
https://medium.com/omarelgabrys-blog/building-restful-apis-with-lumen-and-oauth2-8ba279c6a31#.if5nu88p3
You are on the right track. Good luck and Godspeed.

Convert webapp w/ Yii to native app - Apache Cordova & Netbeans

I have a question about web and native app development and integrating multiple frameworks.
I currently have a web app (html 5, css, js/jquery, php, mysql) and want to make available as a native app on Android and iOS. It uses Yii framework and I was thinking about using Netbeans IDE and Apache Cordova to make the conversion. How do I go about this? Can someone supply some links or an explanation to clear things up for me?
If you have a different method you'd like to recommend instead of Cordova, I'd appreciate that too. Please provide why you prefer that method though.
I've seen plenty of information on this forum and the web that explains this process, but non with Yii in mind.
Thank you for all and any help!
I had the same issue. since we have decided to drop the native app and use an html5 website design i picked, Yii+backbone.js .
in your case, if you plan on building a native app, the backend ( PHP or Yii in your case ) will not be used as a smart web server , because you will use a JS framework.
Known and well loved and used frameworks are:
angular.js
backbone.js
knockout.js
ember.js
Keep in mind, php is a server side language. Its not client based. Yii could serve as a backend providing the data thats all. When you want to use cordova you need a client side framework like jquery mobile.

Web Application development

I want to develop an web application which i have Developed in c# previously.
Now I want to make the same banking application online. So please suggest me the process or Framework i should use to fulfill above.
I am new in web development but i have knowledge of JavaScript, PHP, CSS, HTML and more required for design and coding.
But i don't know how to use this knowledge please help me. Up-till now i have created UI for the project but i don't know where the code should reside how to call them etc.
Help will be Appreciated.
If you've already developed this in C# you can keep with C#. You can create C# web applications. I do believe, in fact, that this site is built using C#. :-)
If you want to learn another web language or technologies, there are plenty of tutorials, books, videos, and classes out there to help you.
Search around the web about developing web applications in .net. there should be plenty of articles covering that area. But basicly, i would say you should go for a Form based Web Application. That way you can make most use of the c# skills you already have. Read about that and the css html and javascript skills should give you a nice application. The deployment using IIS servers etc, you might need some help with if you dont have any experience with that. Maybe a nice article on the web could guide you through that as well.
Hope this helps!
Lookat sencha website,It has many products aimed on fast building web app, and you don't need to learn a lot about CSS,HTML,JS.
I would recommend you to try using Python(Django)or PHP(but I prefer the first one) on the server side + ExtJS for the UI(with ExtJS you can easily create great UIs).. But I don't really think that it's a good decision for business. For getting started - it's great but for business projects - I'm not sure..
As you already developed you application in C# then its better to use ASP.Net, so you can use your C# code as well, and if you don't have much knowledge in asp.net its really very easy to learn also, for that you have to go through some good books and some sites like asp.net etc
If you are already familiar with desktop development, you should take a look at Agile Toolkit, which is a web-based framework inspired by desktop development.
It is very helpful when you need a to produce a lot of inexpensive UI specifically for data management.

How to write a REST API?

I'm writing an iPhone app as a hobby project and it will need a web service to provide it with data. It's not very different from what I do at work, but at work I only write views and controllers. Someone else is responsible for writing the model and usually the clients provide the web service.
I have done some web programming before, back when everyone were using MySQL and PHP, so my skills are a bit outdated, but I'm confident that I would be able to pull it of using the techniques I already know. However, I don't want to waste my time using obsolete tools. I've figured out that the state of the art would be to write a REST API. I was thinking that there should be some pretty good frameworks out there that pretty much just gives you a REST API with CRUD functionality as soon as you've defined a model.
I guess my question is: What would be the fastest way to get a REST API up and running? I really just want to focus on writing the iPhone app and not spend too much time on this API. It would be great if I could get web administration and revision history too. I should also add that the API isn't supposed to be public, so support for authentication would be great as well.
Just to be clear. I wouldn't mind a PHP framework. In fact it could possibly be better since I know that my current hosting supports it.
EDIT:
The links below which apparently were good for 3 years are no longer working so I went and found a couple of new tutorials that I think are going to stick around for a while. These are on the Ray Wenderlich site, a very well respected ios dev tutorial site. The first article actually references the broken links below but it is complete within itself:
How To Write A Simple PHP/MySQL Web Service for an iOS App
and the second one has a little twist to it. It used parse.com on the backend and AFNetworking. Both of which are quite excellent.
How To Synchronize Core Data with a Web Service – Part 1
I have fixed the broken links below by finding the articles in the way back machine. People seem to like the links so I will keep them. The links above should provide more food for thought.
I am doing exactly the same thing with my iphone app. I found this article on building a RESTful API in PHP:
https://web.archive.org/web/20130910164802/http://www.gen-x-design.com/archives/create-a-rest-api-with-php/
and there is also a followup article here:
https://web.archive.org/web/20130323001500/http://www.gen-x-design.com/archives/making-restful-requests-in-php/
with a link to source code at the bottom of the article.
I have programmed a REST API in ZEND Framework using the Zend_Rest_Controller, on the iPhone I used ASIHTTPRequest. My experience with both where good. At the beginning I had some trouble setting up ZEND and connecting it to mySQL, but once I figured out how to do it I was able to write the API very quickly. I can share more information with you if you have any further questions.
EDIT: There seems to be no official documentation on Zend_Rest_Controller. This link describes how to use it to create your API. You simply have to disable rendering in the init() of your subclass and implement the methods for each REST call.
Just to let you know:
I ended up using Ruby on Rails.
EDIT: Since this answer has been downvoted for not providing the reason behind choosing Ruby on Rails and also no instructions on how to write a REST API with it, I thought I would give you my motivation and some simple instructions.
I started reading a book about Ruby on Rails and realized that all I needed to do was to use scaffolding and I got a JSON REST API for free.
Here's a good guide to get you started: http://guides.rubyonrails.org/getting_started.html
When you have your Ruby on Rails environment up and running, creating your REST API isn't harder than running:
$ rails generate scaffold Post name:string title:string content:text
(Example from the above link.) I also found that Rails is very easy and free to deploy to heroku, which meant that I didn't have to pay for hosting for my very basic, low traffic, REST API. There are many other reasons why I am very happy to work with Ruby on Rails, but that's beyond the context of this question.
I followed a quite simple tutorial for creating RESTful APIs with PHP:
Corey Maynard - Creating a RESTful API with PHP
The main concept includes:
one abstract class that handles the parsing of the URI and returning the response, and
one concrete class that consists of just the endpoints for the API.
What about Python?
I'd use Python, Django and Piston.
I'd generate Django models from your
existent DB using inspectdb.
Add the Django admin to your models.
Add Django Piston to your app.
Profit.
With no experience with Python or Django probably it'll take you a day to develop this solution and all code is unit tested and proved to work.
If you want to use PHP I recommend using the CodeIgniter framework with Phil Sturgeon's REST server:
http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2
https://github.com/philsturgeon/codeigniter-restserver
Checkout the following PHP class that follows MVC.
http://www.phpclasses.org/package/5080-PHP-Implement-REST-Web-services-servers.html
Hope this helps.
If you already know PHP, there's nothing wrong with a PHP/MySQL backend. You can send all responses in iPhone-compatible plist xml format, and instantly turn the response into a NSDictionary/NSArray/NSNumber data structure with this short snippet of code:
NSString *response = [request responseString];
NSData* plistData = [response dataUsingEncoding:NSUTF8StringEncoding];
NSPropertyListFormat format;
NSString *errorStr;
NSDictionary* plist = [NSPropertyListSerialization propertyListFromData:plistData
mutabilityOption:NSPropertyListImmutable
format:&format
errorDescription:&errorStr];
I also use the ASIHTTP package for forming URLs, sending asynchronous requets, and receiving the responses, I highly recommend it:
http://allseeing-i.com/ASIHTTPRequest/
You should use whatever languages you are comfortable with for the web service. Any language that can formulate REST responses to requests is fine.
That said, if you want to get something running quickly, I suggest using Python on Google App Engine. It's free and you can use Java instead of Python if you so desire. App Engine supports authentication using OpenID and/or Google Accounts (not sure if they're mutually exclusive) so that should make things easier to code.
As far as making the requests on the iOS device, I suggest using ASIHTTPRequest.
Another option is restSQL, an ultra-lightweight persistence framework. See http://restsql.org. It supports MySQL and PostgreSQL and runs in a standard Java EE container, e.g. Apache Tomcat.
restSQL is a very unconventional data access layer. restSQL is not an object-oriented view of the database. It presents flat or hierarchical "views" of relational database tables. These views are query-able and updatable through a simple REST-based HTTP or Java API. The HTTP interface is based on REST principles, which use HTTP’s built-in features, rather than abstracting away from them.
You want a 'REST API with CRUD functionality' and that's exactly restSQL's sweet spot. You could do this with no code. Simply define your SQL Resources via XML files and start doing HTTP calls against them with full CRUD capability.

How to design a mobile-based application for examination assessment

I want to design a mobile-based application that enable lectures set question through iphone.
I have had an website designed by PHP that lecture can set question through internet.
How to change and start?
Please tell me the detailed process.
Thank you very much.
If you are trying to design a mobile WEB application PHP should not be your first concern.
You will first need to understand the differences of styling web apps using CSS for mobile phones. There are some frameworks out there that can help you with this - I have never used one myself but a quick Google found http://www.phonegap.com/.
If you want to build actual native apps you will need to build them in that phones native language - iPhone is Objective-C, Android is a version of Java and so on.
Start by reading this:
http://webdesign.about.com/od/mobile/a/write-web-pages-for-the-iphone.htm
and then go directly to specifications.
Sencha Touch is also one of the more popular frameworks to build mobile apps with HTML5/Javascript. Of course you can use any server side scripting language like PHP with it.
Building native apps for mobile devices is much different than building a web-based application for use by a larger (compatible) audience. If you desire the look and feel of a native app for your project, then you might think about building and app for the most popular of mobile device operating systems, such as for the iPhone, Blackberry, Android and any other mobile devices you want to include. Think of the native app for the mobile device as the customer service counter at your local department store, its a friendly and welcoming interface put in place to get you to the information you seek, quickly and efficiently. That's pretty much what your native application would be doing, if constructed with portability in mind. Which means you build a customer service counter for all different devices, while the PHP web-based application would become the tie in for all these devices onto one main source of information, your web server.
There are many ways to build both web-apps and mobile-apps, and even more ways to make them all interoperable. How you build the entire system from the floor up will definitely have an impact on the scalability, administration and interoperability and overall usability of your application.
Regardless of the avenue you plan to take in the development of your application, the core question must be answered. What purpose does this application serve or what need does it meet? By answering this simple question, your answer will present itself, as to what tools to use in the development of your application.

Categories