I'm using Android Studio for 2 Weeks now and I want to write a code, in order to connect to a MySQL Database which is on my own Domain Webspace.
I've tried the Java DB Connector from MySQL itself (mysql-connector-java-gpl-5.1.34.msi).
So first of all i tried the JDBC Connector but i figured out this one is only for SQLLite Databases.
I have bound in the Mysql Java Connector from MYSQL.com and edited the build.gradle and the settings.gradle
SETTINGS GRADLE
include ':app'
include ':Libraries/Mysql-Connector-Java-3.0.17-ga'
include ':Mysql-Connector-Java-3.0.17-ga'
and the latest version of the connector (mysql-connector-java-gpl-5.1.34.msi) into ROOT-libs(selfmade directory) as my DirectoryName was MySQLJ.
I am using API 19
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
applicationId "##################" (my company name censored)
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':libraries:mysql-connector-java-3.0.17-ga')
}
I TRIED IT WITH minifyEnable true and false
so everytime I want to rebuild the Project as taught in this Tutorial
https://www.youtube.com/watch?v=1MyBO9z7ojk
i get this error exception
- Error:(26, 0) Project with path ':libraries:mysql-connector-java-3.0.17-ga' could not be found in project ':app'.
- Error:Configuration with name 'default' not found.
so I searched on stackoverflow for answers and i came to this result:
(problem with ~ default) this library is not for AndroidStudio? Because this library hasn't got a own build.gradle so the source of the error exception with this default thingy is the uncompatible library?
Is it possible to write a code to connect to a MYSQL Database with Android Studio? and Where can i find a library for the MYSQL Connector????