Welcome Guest, Not a member yet? Register   Sign In
How to build a Android app with Codeigniter?
#1

I'm wondering if somebody build a Android app with Codeigniter.
How did you do it?

I have been thinking to use the webview option for Android apps and to serve a slightly different view to the app of my site. I think the agent library can't probably determine if the user is using the app so I would pass a URI parameter.

Is this a good idea or bad practice? Are there better solutions?
Reply
#2

If you want android app then study android/Java.
CodeIgniter is for PHP.

wrong forum?
Reply
#3

Are you maybe talking about just an android compatible website?
Reply
#4

If you want the site compatible with mobile devices you can use bootstrap.
Or just google how to make website responsive with HTML5 and CSS.
Reply
#5

I'm talking about things like phonegap. I would use the html, js and css on the frontend to show in the app.
Reply
#6

In most cases I would just use CSS/JS on my website to make sure everything works well on phones as well as tablets and notebooks/desktops. In most cases, there's little benefit to spending the extra time to make an app, and it has been long enough since I've done so that I'm not sure how much they've closed the gap between native code and things like phonegap.

However, if I absolutely needed to support a mobile app, I would just write a REST API and return the data in JSON or XML rather than pushing it out in an HTML page. Then I could support multiple platforms without having to add a new interface on my server for each platform, and I could still use the same models whether the user is navigating via the website or an external app using the API.
Reply
#7

(08-08-2015, 02:50 AM)Kabouter Wrote: I'm talking about things like phonegap. I would use the html, js and css on the frontend to show in the app.

Hey did you figure this out? I am thinking about using codeigniter as a backend for a mobile app too.
Reply
#8

In most cases, a PhoneGap app exists as a separate entity from your website. However, you can use various plugins (e.g. ContentSync) and features to add content to your app from a website, or even update parts of the app from a website. You could also access data on your website by building an API for your app to access. (In general, you should be very careful about pulling content from a remote URL into your app, as any number of man-in-the-middle attacks may be possible.)

CodeIgniter is not involved in the process of building the app itself. The only time it comes into play is when you choose for your app to access data from a website you build/built with CodeIgniter. In any situation in which your app is retrieving content/data from a CodeIgniter site, CI doesn't care/know that it's an app retrieving the content/data, and the app doesn't care/know that CI generated the data. The app simply retrieves the content/data from a URL, and CI handles the request just as it would if the request came from a browser.

You can try to detect the app by using the User Agent class or setting parameters, but it would be easier to just determine what data/content you need in the app and design an API to deliver it. Then you would create that API in CodeIgniter the same way you would any website, though you would most likely want to return data to the app in a data format (like JSON) rather than in full HTML pages (or HTML fragments).
Reply
#9

Hey mwhitney thanks for your reply. I have been meaning to say so but keep getting distracted.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB