user1716672
user1716672

Reputation: 1073

Loading streamlined web content into PhoneGap app

I'm a complete newbie and am building a HTML5 app with PhoneGap which will present articles uploaded through a custom built CMS in a nice flipboard like manner. The app will present a nice image-heavy interface. When users's click on an image, the article content is loaded.

I will probably build the web backend with the Yii framework, since it's where my experience lies. The CMS will be accessible to a number of moderators who can upload articles. Each article simply has an image and text. General users will not have access to the articles through the web, but only through the app.

I presume I need to use HTTP get requests? Say an article on the cms is accessibe at "www.mydomain.com/article?id=7". If I hit this, I'm getting back all the unnecessary layouts and extra views a website uses.

Is the best way to build streamlined views which just return the image, and the content? So the url: "www.mydomain.com/mobile/article?id=7&type=image" would return just the image for article 7 and

"www.mydomain.com/mobile/article?id=7&type=text" would return the text.

I then use Jquery to create the pretty front page of the app by grabbing, say, 3 images, and hit the "text" links to load the content.

Is this the correct process? Or is there a better one?

Upvotes: 2

Views: 682

Answers (1)

Gajotres
Gajotres

Reputation: 57309

That is a correct process. It can be done in few other ways but you should stick with what you know.

But you should also think about few other things.

First, you have selected a Phonegap tag so I would presume you are creating a mobile web app and not a mobile web page. Here comes a problem. There are two ways of creating a jQuery Mobile mobile app with Phonegap, it can be completely generated on a server side and just displayed or you can send only a basic content and generate a page on a client side.

First option is always better, server side will handle content generation and client side will only show it. But here we come to our first problem. In case you are creating a iOS app (Android will not be affected) that app will be rejected because you are generating your content on a server side. Apple policy in this case is to reject app because this is just a mobile web shown inside a hybrid app.

Now here we have a second problem. Lets say your server side will only act as a web service providing you with only basic content (via JSON or XML). Your client side will need to generate page content. Which is not that bed on a desktop browser, but on a mobile phone browser, it can cause performance problems. jQuery Mobile is known as a resource hungry framework, now combine it with additional content generation and you have a formula for performance disaster.

Basically you should build your web app to be as light as possible. For example, take a look at the Pulse mobile app. It is not resource heavy but still looks nice and professional. SO first thing about GUI layout and how are you going to generate a content.

Upvotes: 1

Related Questions