I have been writing an AndroidAPP for some time ago, basically creating an APP that can be run locally on a single machine on a mobile phone .. So I want to learn about the background of the application and plan to use PHP + mysql. I am a little white man in the background. I don't know how to learn. What design patterns or frames do you need to learn? Some time ago, I have been writing an Android APP, basically making an APP that can be run locally on a single machine on a mobile phone .. So I want to learn about the background of the application and plan to use PHP + mysql. I am a little white man in the background. I don't know how to learn. What design patterns or frameworks do you need to learn? Find a learning route !! Thank you.
Reply content:
I have been writing an Android APP for some time ago, and basically made an APP that can be run locally on a mobile phone on a single machine .. So I want to learn about the background of the application and plan to use PHP + mysql. I am a little white man in the background. I don't know how to learn. What design patterns or frameworks do you need to learn? Find a learning route !! Thank you.
1. To facilitate development, select a PHP framework, suchThinkPHP
Yii
CI
.
2. Understand API related knowledge, such:RESTful API
And learn about the PHP framework you selected and how to develop API interfaces.
3. Understand JSON or XML (rarely used). JSON is recommended for data transmission.
4. Use the HTTP class library on Android to request your PHP interface.
Backend is a big topic. You can learn a framework such as laravel or directly seek open api exercises. Learn about android first.
I suggest learning or writing from native PHP.
If you use YII2, the framework has done too much for you and it is hard to know what the native looks like.
Android calls interfaces written in php, that is, php files. Don't learn any frameworks at the beginning. You just need to learn the basics of php. The framework is also written on the basis of php. A poor foundation is a tree without roots, which is not far from programming. Please refer to the following link for more information: http://www.cnblogs.com/xrq730/p/5260294.html. Although it is true, you can see the importance of the basics.
There is a "best practices for Android and php development". You can take a look at it with an electronic version,
If PHP is just the beginning, we recommend that you use a framework that helps you complete most of the work. You can concentrate on your business logic and take the time to study its implementation methods.
The server uses PHP to provide a restful interface for android to call, and then studies oauth.
For android, the class libraries I use to call APIs include okhttp and fit2 android-oauth-client, which can provide a lot of convenience.
In terms of framework selection, it is better to choose a microframework Slim that claims to be able to quickly develop APIs.
The following is an excerpt from the Slim Website:
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
Translation:
Slim is a PHP micro-framework that helps you quickly develop simple and powerful web applications and APIs