Skip to content

An app built with Cordova-PhoneGap for fetching API, https or http request.

Notifications You must be signed in to change notification settings

ronycse778/cordova-api-fetch

Repository files navigation

cordova-api-fetch

An app built with Cordova-PhoneGap for fetching API, https or http request.

Please, cover my another cordova repository first, so it will be easy.
https://github.com/ronycse778/cordova-phonegap-android-studio

For API server I use this repository
https://github.com/ronycse778/laravel-simple-rest-api

Type ipconfig in CMD, to find pc ip. suppose(192.168.68.108)
Clone the API server repository and follow processes and run with

php artisan serve --host=0.0.0.0

So, basically the server will run in http://192.168.68.108:8000
If server is ok, it can be checked with the link http://192.168.68.108:8000/api/v1/users in browser.
No login is required.

As this link is http server so, a cordova advanced http plugin is required. Install it in app project by

cordova plugin add cordova-plugin-advanced-http

To show bug, output or anything in android studio console add

cordova plugin add cordova-plugin-console

After importing the project to android studio, to bind this ip(192.168.68.108)

  1. Update your AndroidManifest.xml to use the network security configuration.
    <application
    android:networkSecurityConfig="@xml/network_security_config"
    ... >

  2. Create a file named network_security_config.xml in the res/xml directory of your project (create the xml directory if it doesn't exist).
    content of this xml not shown in here, so check it from snapshot from Data.Source folder

To use this repository:
Clone it, unzip node_modules.zip, platforms.zip, plugins.zip
Change ip address from www folder/index.html file.
Check app ouput snapshot.

Done

About

An app built with Cordova-PhoneGap for fetching API, https or http request.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published