diff --git a/app/build.gradle b/app/build.gradle index c5c39717..3b29df15 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,11 +20,12 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + compile fileTree(include: ['*.jar'], dir: 'libs') 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:25.1.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' + compile files('libs/jsoup-1.10.2.jar') } diff --git a/app/libs/jsoup-1.10.2.jar b/app/libs/jsoup-1.10.2.jar new file mode 100644 index 00000000..75f716b5 Binary files /dev/null and b/app/libs/jsoup-1.10.2.jar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e3fabaa5..d6d7a65d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,8 @@ + + { @@ -13,29 +16,42 @@ public class Login extends AsyncTask { String password; String county; Activity activity; + String test; public Login(String emailT, String passwordT, String countyT, Activity mainAC){ email = emailT; password = passwordT; - county = "powiat" + countyT; + + county = "powiat" + countyT.substring(7); activity = mainAC; } @Override protected Void doInBackground(Void... params) { + + String htmlDefault = "https://cufs.vulcan.net.pl/Default/Account/LogOn"; + + try { + Connection.Response initial = Jsoup + .connect(htmlDefault) + .data("LoginName", email) + .data("Password", password) + .method(Connection.Method.POST) + .execute(); + + Map loginCookies = initial.cookies(); + + } + catch (IOException e){ + test = e.toString(); + } + return null; } protected void onPostExecute(Void result) { super.onPostExecute(result); - new AlertDialog.Builder(activity) - .setTitle(R.string.warning_label) - .setMessage(R.string.error_feature_text) - .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) {} - }) - .setIcon(android.R.drawable.ic_dialog_alert) - .show(); + Toast.makeText(activity, test, Toast.LENGTH_LONG).show(); } } diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 18bde8be..b556b493 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -10,5 +10,5 @@ Aplikacja ta nie jest ukończona, więc mogą występować różnego rodzaju błędy lub dane funkcje nie bedą działać. Prosimy o cierpliwość i wyrozumiałość. Ostrzeżenie Brak danych logowania - Funkcja którą chciałeś urucThe function you wanted to run does not workhomić nie działa + Funkcja którą chciałeś uruchomić nie działa \ No newline at end of file