Dynamic Form

Android data management and sync with backend system
Demo   Download APK   Buy Now

Documentation

Material that provides official information about the product

If your server meets the following requirements, this app will run on it.

Server side requirement
  • Server Linux/Unix (Recommended), Windows or Mac OS X
  • Web Server Apache (Recommended), Microsoft IIS or any similar web server
  • PHP Version PHP v5.4 or above
  • Database MySQL v5 or higher suggested

Client side requirement
  • Chrome
  • Firefox
  • Safari
  • Internet Explorer 9+
Upload application to server The installation is a simple process that should not take more than a few minutes. The following installation guide will help you to install the app on your server.
  • Unzip Zip Package.
  • After unzip, there are 3 folder (Backend, Frontend and Database)
  • Upload the Backend folders into your server. Normally the index.php file will be at your root.

Setup Android Application The installation is a simple process that should not take more than a few minutes. The following installation guide will help you to install the app on your server.
  • Open folder Frontend with Android Studio.
  • From Android Studio, go to app/res/xml/network_security_config.xml, change the domain with your domain.
    < network-security-config>
        < domain-config cleartextTrafficPermitted="true">
            < domain includeSubdomains="true">dynamicform.cipta.web.id< /domain>
        < /domain-config>
    < /network-security-config>
                         
  • And then, open Class Constant.java, change the SERVER_URL with your own.
    public class Constant {
        public static Context applicationContext = null;
    
        public static String SERVER_URL = "http://dynamicform.cipta.web.id/";
    
        public static String BASE_URL = SERVER_URL + "index.php/mdataaccess/";
        public static String ASSET_URL = SERVER_URL + "uploaded/";
        public static String PREF_IS_LOGIN = "PREF_IS_LOGIN";
        public static String PREF_AUTH_TOKEN = "PREF_AUTH_TOKEN";
        public static String FOLDER_SAVE = "Android/data/id.web.cipta.dynamicform/";
        public static String DEFAULT_FILENAME = "dynamicform_";
        public static String TABLE_FORM = "dynamicfield";
    }
                         

Import Database. The application needs a MySQL database to store data. You can either use your existing MySQL database or create a dedicated MySQL database for the application on your server. Take note of the username, password, database name, and hostname as you create the database. You will enter this information for database configuration.
  • Create New Schema on your MySql Database
  • Import file database.sql
Database Configuration. For the database configuration, open the application/config/database.php file with a text editor and set your database settings.

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',      
    'username' => 'root',                   //fill with your username
    'password' => '',                       //fill with your password
    'database' => 'database_db',           //fill with your schema
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);
                     
This model use five methods, there are:
  • getByQuery. to select the data.
  • insert. to insert the data.
  • insertRet. to insert the data and return the id.
  • update. to update the data.
  • delete. to delete the data.
We created the contoller with standarization and the code adheres to PSR standards. Every contoller user our method standarization, there are:
  • index() in this method you should provide the data for the main page.
  • gridview() to show into the table, you should retrieve data from database and declare it in this method.
  • generateId() this method is a function to generate id or unique id.
  • form() to show data and form that you can insert and update.
  • save() this method will save the data to the database.
  • view() to show data.
  • delete() this method will delete the data.
We created the Android Structure to make application clean and easy to develop, here is the structure:
  • Dataaccess/ Connection to the server.
  • Features/ All activity and core function.
  • Helpers/ Function helpers.
  • Libraries/ All libraries.
  • Model/ Data model.
Android configuration at build.gradle
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "id.web.cipta.dynamicform"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
                     

Setup your url to Server at Constant.java
public static Context applicationContext = null;
public static String SERVER_URL = "http://dynamicform.cipta.web.id/"; // <---- CHANGE THIS URL WITH YOURS
public static String BASE_URL = SERVER_URL + "index.php/mdataaccess/";
public static String ASSET_URL = SERVER_URL + "uploaded/";
public static String PREF_IS_LOGIN = "PREF_IS_LOGIN";
public static String PREF_AUTH_TOKEN = "PREF_AUTH_TOKEN";
public static String FOLDER_SAVE = "Android/data/id.web.cipta.dynamicform/";
public static String DEFAULT_FILENAME = "dynamicform_";
public static String TABLE_FORM = "dynamicfield";
                     

Dependencies at build.gradle
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.github.d-max:spots-dialog:0.4@aar'
    implementation 'com.google.code.gson:gson:2.2'
    implementation 'com.squareup.okhttp3:okhttp:3.2.0'
    implementation 'com.alexzh:circleimageview:1.1.2@aar'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.code.gson:gson:2.2'
    implementation('com.weiwangcn.betterspinner:library:1.1.0') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
    }
}