System requirement:
Android Studio requirement 3.5 or above
At the end of "Project -> Gradle Scripts -> gradle.properties(Project Properties)" add these lines:
android.useAndroidX=true
android.enableJetifier=true
At the end of "Project -> Gradle Scripts -> build.gradle(Project:)" add these lines:
...
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
Change "Project -> Gradle Scripts -> build.gradle(Module:)" these lines:
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.2' ->
androidx.test.espresso:espresso-core:3.2.0
implementation 'com.android.support:appcompat-v7:28.0.0' -> androidx.appcompat:appcompat:1.1.0
implementation 'com.android.support.constraint:constraint-layout:1.1.3' -> androidx.constraintlayout:constraintlayout:1.1.3
androidTestImplementation 'com.android.support.test:runner:1.0.2' -> androidx.test:runner:1.2.0
implementation 'com.google.android.gms:play-services-ads:17.2.1' -> com.google.android.gms:play-services-ads:18.2.0
For Example:
...
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
implementation 'com.google.android.gms:play-services-ads:18.2.0'
In Java code, change import android.support.v7.app.AppCompatActivity; to import androidx.appcompat.app.AppCompatActivity;
In activity xml, change android.support.v7.widget.Toolbar to androidx.appcompat.widget.Toolbar
References:
Wednesday, September 4, 2019
Android Studio 3.5.0 and Migrate to AndroidX
Thursday, August 1, 2019
Debian Stretch: Distribution Upgrade to Debian Buster (10)
Prepare apt /etc/apt/sources.list, change stretch to buster
my apt source list:
Note on error when running apt-get update:
E: Release file for http://kambing.ui.ac.id/debian/dists/buster/InRelease is expired (invalid since 265d 4h 18min 17s). Updates for this repository will not be applied.
use other sources e.q change "deb http://kambing.ui.ac.id/debian/ buster main contrib
" to "deb http://mirrors.kernel.org/debian buster main contrib"
If you used oracle mysql or oracle virtualbox, you need to modify to "buster" these files:
/etc/apt/sources.list.d/mysql.list
/etc/apt/sources.list.d/virtualbox.list
Running upgrade process
Restart your computer
You can clean and remove unused temporary to make your system "tidy"
By default, Debian 10 use kernel 4.19, you mau remove your old kernel.
Note:
DO NOT DELETE linux-image-4.19!
Reference:
https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html
https://garasiku.web.id/web/joomla/index.php/tips/debian/14-debian-jessie-upgrade-to-debian-9-codename-stretch
Intel(R) Atom(TM) CPU N455 @ 1.66GHz (Fujitsu) takes 3 hours to completed. Don't worry, It's much faster then windows 10 update or windows update clean up LOL.
my apt source list:
# Debian 10
# SECURITY
deb http://security.debian.org/ buster/updates main
# Main
deb http://kartolo.sby.datautama.net.id/debian/ buster main
# NON FREE
deb http://httpredir.debian.org/debian buster main contrib non-free
# BACKPORT
deb http://ftp.debian.org/debian buster-backports main
Note on error when running apt-get update:
E: Release file for http://kambing.ui.ac.id/debian/dists/buster/InRelease is expired (invalid since 265d 4h 18min 17s). Updates for this repository will not be applied.
use other sources e.q change "deb http://kambing.ui.ac.id/debian/ buster main contrib
" to "deb http://mirrors.kernel.org/debian buster main contrib"
If you used oracle mysql or oracle virtualbox, you need to modify to "buster" these files:
/etc/apt/sources.list.d/mysql.list
/etc/apt/sources.list.d/virtualbox.list
Running upgrade process
# apt-get update
# apt-get upgrade
...
Fetched 238 MB in 14min 50s (268 kB/s)
...
# apt-get dist-upgrade
...
Fetched 969 MB in 45min 30s (355 kB/s)
...
Restart your computer
# cat /etc/debian_version
10.0
# uname -an
Linux fujitsu01 4.19.0-5-amd64 #1 SMP Debian 4.19.37-5 (2019-06-19) x86_64 GNU/Linux
You can clean and remove unused temporary to make your system "tidy"
# apt-get autoclean && apt-get autoremove
By default, Debian 10 use kernel 4.19, you mau remove your old kernel.
# apt-get remove linux-image-4.9.0-9-amd64
Note:
DO NOT DELETE linux-image-4.19!
Reference:
https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html
https://garasiku.web.id/web/joomla/index.php/tips/debian/14-debian-jessie-upgrade-to-debian-9-codename-stretch
Intel(R) Atom(TM) CPU N455 @ 1.66GHz (Fujitsu) takes 3 hours to completed. Don't worry, It's much faster then windows 10 update or windows update clean up LOL.
Tuesday, June 11, 2019
android studio 3.4.1 and google admob change
In build.gradle (Module:app) change
...
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
...
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-ads:17.2.1'
In AndroidManifest.xml add
<manifest> <application> ... <meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true"/> </application>
</manifest>
Thursday, June 6, 2019
defender locking bignox virtual disk
windows defender sometimes open file in background process, to scan for malicious code. If defender (or other antivirus) open bignox virtual disk it will lock it and cause your emulator crash. You need to exclude virtual disk that used by bignox. Here are the steps you need to do:
- Open your windows defender (or your antivirus)
- Go to setting "Virus & thread protection settings"
- in "Exclusions" click "Add or remove exclusions"
- Click "Add an exclusion" and choose "File type"
- in "Enter extension" box type "vmdk"
- repeat step 4 for file type "vbox" and "vdi"
You may want to increase your emulator by excluding these files:
- C:\Program Files (x86)\Bignox\BigNoxVM\RT\NoxVMSVC.exe
- C:\Program Files (x86)\Nox\bin\Nox.exe
Thursday, April 25, 2019
Codeigniter: query builder select, insert, update and delete
Query table:
Query table with like filter:
Insert row in table:
Update row in table for spesific id
Delete row:
Php 7.2 and Codeigniter 3.1.10
$this->result = $this->db->get('ca_brand',$mmax, 0);
if ($this->result) {
return true;
} else {
return false;
}
Query table with like filter:
$this->db->like('name', $keyword); // buildin mysql escape
$this->result = $this->db->get('ca_brand',0, $mmax);
if ($this->result) {
return true;
} else {
return false;
}
Insert row in table:
// buildin mysql escape character
$data = array('name' => $name);
$this->db->insert('ca_brand', $data); // return true on success
$insert_id = $this->db->insert_id(); // get id
Update row in table for spesific id
// buildin mysql escape character
$id = intval($id);
$data = array ('name' => $name);
$this->db->where('id', $id);
//$this->db->update('ca_brand',$data, "id = "$id ); // option 1
$this->db->update('ca_brand',$data); // // option 2
$numaffectedrow = $this->db->affected_rows(); // to get nummber affected row
Delete row:
$id = intval($id);
$this->db->where('id', $id);
$this->db->delete('ca_brand');
$numaffectedrow = $this->db->affected_rows(); // to get nummber affected row
Php 7.2 and Codeigniter 3.1.10
Subscribe to:
Posts (Atom)