Jump to content

How we can generate android app / iphone app from web server using php


PHPLazy

Recommended Posts

I want to build a online "app builder" project that users can create android / iphone applications online without any coding knowledge. These sites are very common in market. They offer onclick app builder.

I have skill in development of web applications using php frameworks.

My question is

  1. How we can generate android apk from our server after getting the necessary information from user? (Appname, icon, packagename etc)

  2. PHP can do this entire task?, if yes any framework for that?

  3. Can you give me some basic tips to generate apk from our server?

  4. Can we genrate both android and iphone app from one single code?

  5. What are the requirements needed for the server?

Anybody having skills in these areas, please help me. I need basic tips to get started this project.

Thanks

Link to comment
Share on other sites

I think it's safe to assume a few things here:

  • These sites are using a Cross platform Mobile app development framework.  There is quite a list of these, many of which use standard web assets (html, css and javascript) for their source.  This is an excellent wrap up and summary of the many cross platform mobile development options out there, along with pros and cons for each.
  • They an account system that handles the customization options, storage of assets, builds, developer accounts etc.
  • They are wrapping up and automating the process of building an app in their system
  • They have canned solution code that can be integrated into the application

Can PHP be used to create a software as a service site like this?  Absolutely

What framework should you use?  By far the 2 leading modern PHP frameworks are Symfony and Laravel.  Either one is capable.

Requirements for your server(s) I would suggest that you build around a cloud service that will allow you to expand and contract your capacity as needed, and most likely have queues and micro service architecture so that individual tasks can be performed.  For example, since your system would need to compile/bundle/process at various times, you probably want that to be asynchronous.  The meat of your system will be built around whatever framework you choose, and the build tools they provide running in the OS.

You also will have the need to store data for each client, so a distributed storage system like Amazon S3 would be extremely valuable for keeping track of assets, source and generated application files on a per user basis.

Without a doubt, in order to create a system like this, you will need to be an expert in the use of the cross platform framework in order to understand how to automate its use.

Link to comment
Share on other sites

On 12/27/2018 at 12:37 AM, gizmola said:

I think it's safe to assume a few things here:

  • These sites are using a Cross platform Mobile app development framework.  There is quite a list of these, many of which use standard web assets (html, css and javascript) for their source.  This is an excellent wrap up and summary of the many cross platform mobile development options out there, along with pros and cons for each.
  • They an account system that handles the customization options, storage of assets, builds, developer accounts etc.
  • They are wrapping up and automating the process of building an app in their system
  • They have canned solution code that can be integrated into the application

Can PHP be used to create a software as a service site like this?  Absolutely

What framework should you use?  By far the 2 leading modern PHP frameworks are Symfony and Laravel.  Either one is capable.

Requirements for your server(s) I would suggest that you build around a cloud service that will allow you to expand and contract your capacity as needed, and most likely have queues and micro service architecture so that individual tasks can be performed.  For example, since your system would need to compile/bundle/process at various times, you probably want that to be asynchronous.  The meat of your system will be built around whatever framework you choose, and the build tools they provide running in the OS.

You also will have the need to store data for each client, so a distributed storage system like Amazon S3 would be extremely valuable for keeping track of assets, source and generated application files on a per user basis.

Without a doubt, in order to create a system like this, you will need to be an expert in the use of the cross platform framework in order to understand how to automate its use.

Thank you for the informations.

Okay let me say if everything is installed in our server to build the apk.

Assume that

Someone comes to our website interface to create an hello world app. We accept project name from the interface.

In Apache Cordova the command to create project is 

cordova create hello com.example.hello HelloWorld

This is the command to create a hello world project.

My question is how we can run the entire command from our php code with the project name which is taken from user input & How we can show the response to user.

If project is successfully created.

Im really confused to run the command from our code.

Please give me some tips for this,  so i can continue..

 

Yii Framework is okay for this? 

Thanks

 

Link to comment
Share on other sites

11 hours ago, PHPLazy said:

My question is how we can run the entire command from our php code with the project name which is taken from user input & How we can show the response to user.

If project is successfully created.

Im really confused to run the command from our code.

Program Execution

There are several options for running a program.  exec() is most common in my experience.

Link to comment
Share on other sites

2 hours ago, PHPLazy said:

Are you sure that these sites are using the same method to run commands from pure codes? 

Pretty sure.  The only people who would know for a fact are the people who already built the sites you referenced.

With that said, as an example of something similar, I was the lead engineer for a project that built a social network application some years ago.  It was similar in some ways to instagram, in that users could share streams of media with friends, and was designed to be a mobile application, although it also had a web client.  As part of the architecture we accepted music, video and images.  

The subsystem that handled this accepted most every type of video there is, and then processed and transcoded that to mp4 video at various bitrates.  It also extracted a number of different screenshots from the video in order to have cover images in the stream.  It also accepted images and sound files.  It was essentially a version of what youtube and other streaming video sites do.  

The primary tool that did the complicated video transcoding was ffmpeg.  Because the site backend was written in PHP, I found and enhanced a PHP component library to help with the php integration and make it easier to fit it into our overall backend infrastructure.  The library which has been enhanced and added to over the years since is called php-ffmpeg.    At the time there were a number of things the library didn't have that I wanted, so I forked it on github and added the things I needed.   Primarily it just automated the various command line settings you can send to ffmpeg, and called exec(), but when you're building something that you want to be scalable, there's a lot of work that typically needs to go into making it work beyond the actual generation of transcoded video files.  There were queues and organized storage of the files and other things needed so that the individual conversion jobs could run asynchronously and be kept seperate.  

Without a doubt, ffmpeg was the foundation of the pipeline, but there was also a lot of work put into all the associated requirements that come along with having a business or service, as well as the DevOps work that you need to make sure your system works to an acceptable degree when you have more than one user using it.  

When people ask about frameworks, my standard answer at this point is to use either Laravel or Symfony.  You could certainly use Yii but is not one of the PHP standard bearers at this point.  I don't advise people to use Cake or Codeigniter or Zend framework either. 

Link to comment
Share on other sites

1 hour ago, gizmola said:

Pretty sure.  The only people who would know for a fact are the people who already built the sites you referenced.

With that said, as an example of something similar, I was the lead engineer for a project that built a social network application some years ago.  It was similar in some ways to instagram, in that users could share streams of media with friends, and was designed to be a mobile application, although it also had a web client.  As part of the architecture we accepted music, video and images.  

The subsystem that handled this accepted most every type of video there is, and then processed and transcoded that to mp4 video at various bitrates.  It also extracted a number of different screenshots from the video in order to have cover images in the stream.  It also accepted images and sound files.  It was essentially a version of what youtube and other streaming video sites do.  

The primary tool that did the complicated video transcoding was ffmpeg.  Because the site backend was written in PHP, I found and enhanced a PHP component library to help with the php integration and make it easier to fit it into our overall backend infrastructure.  The library which has been enhanced and added to over the years since is called php-ffmpeg.    At the time there were a number of things the library didn't have that I wanted, so I forked it on github and added the things I needed.   Primarily it just automated the various command line settings you can send to ffmpeg, and called exec(), but when you're building something that you want to be scalable, there's a lot of work that typically needs to go into making it work beyond the actual generation of transcoded video files.  There were queues and organized storage of the files and other things needed so that the individual conversion jobs could run asynchronously and be kept seperate.  

Without a doubt, ffmpeg was the foundation of the pipeline, but there was also a lot of work put into all the associated requirements that come along with having a business or service, as well as the DevOps work that you need to make sure your system works to an acceptable degree when you have more than one user using it.  

When people ask about frameworks, my standard answer at this point is to use either Laravel or Symfony.  You could certainly use Yii but is not one of the PHP standard bearers at this point.  I don't advise people to use Cake or Codeigniter or Zend framework either. 

Cool gizmola!

 

Got some points and ideas. Let me ask one thing for building apk we need to set different que? 

Because users input necessary details to build apk such as

Icon, appname, packages name, version code, splash, 

We store these details into our global database and make a unique global path for every users. 

Once user build apk, our code write the path into entire configuration file may be gradle.properties for Android.  I don't know about Apache Cordova but I will learn. 

The question is "How we can set building apk task" for different users? 

Possible to call only exec() command for every user? 

Need to make anything before? 

 

Thanks

Link to comment
Share on other sites

I'd guess that what you'd want to do is just create a temporary directory somewhere when you need to build an app for a user and create/modify your cordova project there.

Make the temporary directory.

Create your cordova project

Apply whatever settings/customizations the user specified

Execute the cordova command to build the apk

Copy the apk off somewhere when done

Delete the directory.

Link to comment
Share on other sites

3 minutes ago, kicken said:

I'd guess that what you'd want to do is just create a temporary directory somewhere when you need to build an app for a user and create/modify your cordova project there.

Make the temporary directory.

Create your cordova project

Apply whatever settings/customizations the user specified

Execute the cordova command to build the apk

Copy the apk off somewhere when done

Delete the directory.

Means. 

We need to create different directory for different users? 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.