Thursday, May 31, 2018

Android Studio 3.1.3: fix warning compile, androidTestCompile and testCompile

Fix Warning:
  1. Configuration 'compile' is obsolete and has been replaced with 'implementation'
  2. Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation'
  3. Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'
My Android studio:
  • Android Studio 3.1.3
  • buildToolsVersion "28.0.0"
  • Compile Target SDK 28 / min SDK 17
Open Project -> Gradle Scripts -> build-gradle (Module: app)
  1. Change 'compile' to 'implementation'
  2. Change 'androidTestCompile' to 'androidTestImplementation'
  3. Change 'testCompile' to 'testImplementation'
For exmaple my previous
android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 27
...
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'org.jsoup:jsoup:+'
    compile 'com.google.android.gms:play-services-ads:11.2.2'

}
After update
android {
    compileSdkVersion 28
    buildToolsVersion "28.0.0"
    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 28
...
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:appcompat-v7:27.+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
You may need to change "Gradle Scripts" -> "build.gradle (Project:[your_project_name])"
buildscript {
    repositories {
        jcenter()
        google() 
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Saturday, May 26, 2018

Move/Restore Joomla site to a new server using Kickstart 5.4.2

Tested on Joomla 3.8.3 and Kickstart 5.4.2.
Note: you don't need to install Joomla first, Kickstart will extract your Joomla.
Required:
  1. previous back up using Akeeba Backup for Joomla (jpa or zip file)
  2. MySQL user and password
  3. Read/write permission on web root
Here are the steps:
  1. Download Akeeba Kickstart from https://www.akeebabackup.com/products/akeeba-kickstart.html. Kickstart contains kickstart.php and its supporting files.
  2. Upload and extract Kickstart to your previoes Joomla root for example upload and extract kickstart-core-5.4.2.zip into [your_home]/public_html/joomla.
  3. Upload your backup files to your web root for example upload site-garasiku.web.id-20180104-031734utc.jpa into [your_home]/public_html/joomla. It may take time, depends on your connection speed.
  4. From your browser open URL http://[your_site]/joomla/kickstart.php and click "Click here or press ESC to close this message".
  5. Fill form
    1. Archive file: [your jpa/jps files] e.q. [your_home]/public_html/site-garasiku.web.id-20180104-031734utc.jpa
    2. Temporary directory: [your_ftp_temp_folder] e.q. [your_home]/public_html/tmp
  6. Click "Start" to start extracting your Joomla site backup and click "Run Installer" to reinstall and configure your Joomla site.
  7. It will open ANGIE – Akeeba Next Generation Installer Engine v.5.6.3 in a new tab. Click "Next".
  8. Fill your MySQL access
    1. Database server host name: localhost [Note: check your hosting provider]
    2. User name:    [your MySQL user]
    3. Password:    [your MySQL user password]
    4.  Database Name:    [your MySQL database name]
  9. To continue click "Next", It will give a warning, you may click "Ok" or "Cancel".
  10. If Success, click "Next Step".
  11. It will restore your configuration files. Update your preferences if you wish, and fill your Joomla administrator password.
  12. Click "Next" to finish configuration. It will ask your to clean up your Kickstart. It will clean
    1. Kickstart files
    2. folder Installation
  13. Done and conguratulation!  
REMOVE your JPA/JPS  files from public_html!

Additional Option to change Akeeba backup folder
  1. Create folder for example akeebabackup on your home directory for example [your_home]/akeebabackup.
  2. Open your Joomla Administrator page and update Joomla system if necessary.
  3. "Components -> Akeeba Backup" in "Basic Operation" select "Configuration".
  4. Change Output Directory into your akeebabackup folder for example /home/example/akeebabackup
  5. To change non default backup schema, under "Components -> Akeeba Backup" in "Basic Operation" select "Profiles Management"

Reference:
https://www.akeebabackup.com/videos/1212-akeeba-backup-core/1618-abtc04-restore-site-new-server.html

Connecting domain to web hosting from 2 different provider

I have domain registar in at Indosatm2. After my sponsor refuse to fix the server, I decided to hosting my web on web hosting. After searching web hosting, I choose masterweb for web hosting.
The problem arrise how to connect my domain to web hosting. After searching some information, here is how I do that.
  1. At web hosting, find out name server for your web hosting. If you can not find them, issue ticket to ask name server for your web hosting.
  2. Login into your domain registar.
  3. Go to Manage your domain for example garasiku.web.id.
  4. Select "Name Server" and use "Use custom nameservers (enter below)"
  5. You need at least 2 name server.
    1. Nameserver 1: [Nameserver_from_web_hosting]
    2. Nameserver 2: [Nameserver_from_web_hosting]
    3. Nameserver 3...etc: [optional]
  6. Make sure "Registar Lock" is disable to make it easy to transfer from domain registar provideer to web hosting provider.
  7. Go to "DNS Management" and fill Hostname, Record type "A" and IPv4 address. For eample
    1. Host Name: garasiku.web.id
    2. Record Type: A
    3. Address: [xx.xx.xx.xx]
  8. It takes time to propagate your domain about 24 hours. In my case it took about 6-8 hours. You may check using nslookup your domain points to your web hosting.
  9. Done.