App and Website

Best practices when creating an App AND and a Website from the same database/content?

I realize I’ll need two different Wappler projects.

But, other than that is there anything good to be aware of?

  • Jeff

Hi @sophos707,
Assume you are talking of a Mobile Application?

  • One data source Project (for your API calls).
  • One design Project (can select the Data Source Project Actions from the App Connect drop-down).
  • Install Gradle.
  • Enable CORS in Server Connect Settings.
  • Insure responsiveness throughout your design.
  • Check both Google and Apple Developer minimum requirements for listing Applications.
  • Sign your application with a certificate (can be generated automatically in Google Developer console, not sure about Apple).
  • Sometimes builds can fail, if this happens try running Wappler with elevated permissions (ie as Administrator in Windows),

Those are the basic considerations. Once covered you shouldn’t run in to any issues.

1 Like

Thanks @Dave,
I’m not familiar with Gradle. Use that in conjunction with Wappler?

Could you explain the "One data source Project (for your API calls).

Are you saying to create a Wappler project and make all my API calls inside of there?
Then when I make the website or the app reference those API calls that are in the other project?

Why wouldn’t I just make all the API calls in the the website project and then reference them in the App project?

Thanks!

Yes, that is what I did. I used the website project for the mobile app API. However, I did set up all App API separately within the project. I didn’t share API in both.

1 Like

I’d have them separated as APKs are very easy to decompile which would potentially expose you to security problems if you run them in the same Project (also Android and Apple have no way to run PHP if that is your preference for hosting type, multitude of issues if you steer away from two Projects, that is just one), your call… One Project is for data sources and the other for the design, which you could use as a web application also if you wanted to… The www directory is a fully usable source for a web Project.

Gradle is required to build Android Applications and is out of the remit of Wappler currently, ie is not installed by Wappler. It is a manual process whereby you the user install Gradle. Lots of guides available, am sure I’ve written up a few times on how to install it, just search the Community for answers you should find them.

One Project for your database source and Actions. The ‘design’ Project can then communicate with this Project for API calls. All very easy to set-up.

Like I said have covered the basics in a couple of tutorials, a quick search will locate them for you.

1 Like

If you already have a web Project with Actions of course you can use this Project as the source for API calls. Just to clarify. If you are starting afresh two Projects are required…

2 Likes

@Dave and @Brad,

Since Cordova Apps made in Wappler cannot read PHP APIs… what can they read?

Like, when you made those APIs for the App to read, what were they written in?

Please check the documentation how to use dynamic data with your apps:

1 Like

This is the purpose for the second Project, which will contain your API (Server Connect Actions), you then call these Actions via App Connect in your Design Project. Like selecting any other Server Connect API but you will use the drop-down Project select to pick your API Data Project, then select your Server Connect Actions contained within selected Data Project accordingly. Please search the Community for the tutorials all is explained within them:

https://community.wappler.io/search?q=%20Android%20Mobile%20Application

Mobile applications take more time and planning so be prepared to not just bash one out. There is far more to do than just drag and drop Blocks for example. First insure you have Gradle installed, can not emphasize enough. Without Gradle you will not be able to compile your Project. Again everything is covered in previous conversations here in the Community. Please check for answers already covered prior to posting.

1 Like

When you call an API, it is an http request so it does not care what language the api is written in. It simply makes the request, and consumes the response.

2 Likes

Makes sense, thanks @mebeingken, @Teodor, and @Dave,

Basically, you write your api/database stuff as you would normally in a different project.
But, your App reaches out and uses those.

1 Like

Exactly, that’s the basics of it @sophos707

Server Connect is your API. If on the same host you shouldn’t have an issues, otherwise be sure to configure CORS for the cross origin requests otherwise you may get errors.

I actually had read @Teodor’s post before but it didn’t click until I chatted with you here.

Thanks!

1 Like

You’re very welcome.

The APIs were done in PHP. That’s the reason for the second project. :slight_smile:

1 Like