0

My client has Joomla website with plugins (Mosets tree and JSE events) that basically lists business an events. He wants an android app developed to fetch these info. Immidiately what came to mind, is I create php scripts that query the Database and I call those scripts from my app. In my app, I display the information collected.

Another idea that occurred to me, is to enable RSS feed and then I read this RSS feed.

Is my approach above the right approach? Is there a different way or standard way when developing apps that fetch information from the Joomla website backend?

Please note the website is already mobile friendly but the requirement is to create an app for part of the website. Any pointers are helpful

Snake
  • 14,228
  • 27
  • 117
  • 250
  • Well I would start by finding a plugin of REST API for Joomla, install it and enable. You would save time to develop a script in php and read directly the database. – ramses Jul 23 '15 at 21:01
  • @darkangelo Joomla is made by several components which are little applications themselves, so a REST API plugin compatible with all of them is very difficult to build. There is some attempt but no real winners. – Francesco Abeni Jul 24 '15 at 16:44

2 Answers2

0

Building one or more PHP scripts that query the db and returns the data is definitely the faster and simpler solution.

If you want to build a more robust / compatible solution, you may extend your set of PHP scripts into a full blown REST API application. In that case take a look frameworks like SLIM or SILEX which are very good at this.

There are more complete and elegant solutions but they are probably overkill for your needs.

Edit: why query directly the database

In theory, it seems to be better to NOT access directly the database, and interact with the Mosets Tree component instead; because in that way you will not have to duplicate any logic.

But in my experience, with a very few exceptions, Joomla components are coded so that it's very hard to interact with them programmatically.

Francesco Abeni
  • 4,190
  • 1
  • 19
  • 30
  • The website made by Joomla is made of plug in and one of the plug in is Moset tree which took care of creating the dB and integrate it with the website. When I write the php, I will do the script and access the dB myself right? I mean it is not like reinventing the wheel and I have to somehow go through the plug ins.. Correct? Thanks – Snake Jul 24 '15 at 22:21
  • You are correct. I updated my answer to clarify why I think you should skip Joomla and go directly to the database. – Francesco Abeni Jul 25 '15 at 08:36
0

I answered a similar question regarding Joomla RESTful APIs here:

REST API for Joomla 3.0

Basically, I ended up developing a solution which meshes the Slim PHP micro-framework with the Joomla Framework / CMS (requires Joomla 3.4.3+).

Why?

Well, the main reason is that while using the Slim framework would be OK as a one-off solution, I realized that one would still need to develop all the accompanying ACL and access security, not to mention the actual CMS that might store and manage all the important data in the first place.

Basically, I did the work so you don't have to. Yes, it's a commercial component (must pay to download) but I think it's WELL worth it for what you end up getting out of it.

It's brand new, so the service routes in the cAPI ("Constant API") Core package are still limited, but those are being built-out over time (all included in the core package of course). The component/plugin/library package is architected to allow for easy integration of add-on plugins which will introduce new service routes to add functionality like RESTful JSON APIs for MySQL, MSSQL, MongoDB, LDAP, etc. I already use an alpha version of the LDAP add-on in a an enterprise environment, so I expect that to be available for purchase/download soon.

The point of all this is that you can use an existing Joomla site to drive mobile apps (with some development for Mosets), while taking advantage of built-in user management and ACL, along with token auth (via cAPI).

Let me know if you have any questions.

Community
  • 1
  • 1
Steve Tsiopanos
  • 183
  • 2
  • 9