J
JoMedics
Neues Mitglied
- 0
Hallo liebe Community,
ich habe ein kleines Problemchen.
In der Schule müssen wir eine kleine Android-App als Projekt schreiben. Ich will mir einen Login mit einer entsprechenden Registrierung machen, was alle Daten (Name, Passwort, E-Mail und Klasse) in eine Datenbank speichert und somit automatisch abläuft. Gleich vorne weg, es soll KEINE lokale Datenbank(also SQLite) sein, sondern will es Online mit MySQL erreichen um so von überall zugreifen zu können.
Ich habe mich schon etwas in Datenbanken eingearbeitet, stehe aber trotzdem noch ziemlich am Anfang. Ich habe natürlich erst (so einige Stunden) meinen besten Freund Google bemüht, aber nichts anständiges gefunden, nur "Tutorials" ala "so sieht die App aus, jetzt schreibst du dir noch ein kleines PHP-Skript und das war's". Tutorial heißt für mich verständlich Schritt für Schritt.
Wie dem auch sei, ich habe die App von der Oberfläche soweit fertig und habe mit Eclipse schon ein kleines Programm, um auf die Datenbank zuzugreifen (ich werde zur Verständlichkeit einfach Eclipse und Android Studio sagen. Die App programmiere ich in Android Studio, Java für den Computer in Eclipse).
Mit dem Connector/J funktioniert es eigentlich ziemlich gut, daher würde ich das gerne nach Möglichkeit in die App übernehmen und auf PHP verzichten. Hab da zwar Grundkenntnisse, aber würde trotzdem lieber das bekanntere benutzen.
Mir stehen momentan folgende Fragen im Wege:
- Wie greife ich mit der App auf die Datenbank zu, welche später online sein wird? (auch Connector/J? und ich hab mal was von bind-adress gelesen?)
- Ich werde vermutlich einen Webspace-Anbieter mit MySQL-Zugriff suchen (Angebote mit guten Erfahrungen natürlich gerne gesehen), aber auch da frage ich mich, wie genau der Zugriff dann für mich aussehen wird, per Putty o.ä.?
In diesem Bereich bin ich leider ziemlich unerfahren, aber ich will das unbedingt lernen!
Wenn daher jemand ein gutes Tutorial für mich hätte wäre ich natürlich auch äußerst dankbar, ich will nicht nur den Code abtippen sondern auch verstehen können. Natürlich kann man sich den Code anschauen und rumspielen was ich immer mache und hat bisher auch immer einwandfrei funktioniert, aber das ist meist nur ein kleiner Teil und ich würde gerne das gesamte dahinter verstehen.
Vielen Dank schon mal im Voraus, ich hoffe jemand kann mir da helfen!
MfG JoMedics
Hier die Quellcodes von Eclipse und die zwei XML-Dateien von Android Studio (die Java-Dateien in AS sind hier erst mal nicht notwendig, ist nur die Oberfläche da der DB-Zugriff noch nicht steht, kann sie aber auf Wunsch später gerne nachreichen):
content_registering.xml:
activity_login.xml:
ich habe ein kleines Problemchen.
In der Schule müssen wir eine kleine Android-App als Projekt schreiben. Ich will mir einen Login mit einer entsprechenden Registrierung machen, was alle Daten (Name, Passwort, E-Mail und Klasse) in eine Datenbank speichert und somit automatisch abläuft. Gleich vorne weg, es soll KEINE lokale Datenbank(also SQLite) sein, sondern will es Online mit MySQL erreichen um so von überall zugreifen zu können.
Ich habe mich schon etwas in Datenbanken eingearbeitet, stehe aber trotzdem noch ziemlich am Anfang. Ich habe natürlich erst (so einige Stunden) meinen besten Freund Google bemüht, aber nichts anständiges gefunden, nur "Tutorials" ala "so sieht die App aus, jetzt schreibst du dir noch ein kleines PHP-Skript und das war's". Tutorial heißt für mich verständlich Schritt für Schritt.
Wie dem auch sei, ich habe die App von der Oberfläche soweit fertig und habe mit Eclipse schon ein kleines Programm, um auf die Datenbank zuzugreifen (ich werde zur Verständlichkeit einfach Eclipse und Android Studio sagen. Die App programmiere ich in Android Studio, Java für den Computer in Eclipse).
Mit dem Connector/J funktioniert es eigentlich ziemlich gut, daher würde ich das gerne nach Möglichkeit in die App übernehmen und auf PHP verzichten. Hab da zwar Grundkenntnisse, aber würde trotzdem lieber das bekanntere benutzen.
Mir stehen momentan folgende Fragen im Wege:
- Wie greife ich mit der App auf die Datenbank zu, welche später online sein wird? (auch Connector/J? und ich hab mal was von bind-adress gelesen?)
- Ich werde vermutlich einen Webspace-Anbieter mit MySQL-Zugriff suchen (Angebote mit guten Erfahrungen natürlich gerne gesehen), aber auch da frage ich mich, wie genau der Zugriff dann für mich aussehen wird, per Putty o.ä.?
In diesem Bereich bin ich leider ziemlich unerfahren, aber ich will das unbedingt lernen!
Wenn daher jemand ein gutes Tutorial für mich hätte wäre ich natürlich auch äußerst dankbar, ich will nicht nur den Code abtippen sondern auch verstehen können. Natürlich kann man sich den Code anschauen und rumspielen was ich immer mache und hat bisher auch immer einwandfrei funktioniert, aber das ist meist nur ein kleiner Teil und ich würde gerne das gesamte dahinter verstehen.
Vielen Dank schon mal im Voraus, ich hoffe jemand kann mir da helfen!
MfG JoMedics
Hier die Quellcodes von Eclipse und die zwei XML-Dateien von Android Studio (die Java-Dateien in AS sind hier erst mal nicht notwendig, ist nur die Oberfläche da der DB-Zugriff noch nicht steht, kann sie aber auf Wunsch später gerne nachreichen):
content_registering.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_registering"
tools:context=".RegisteringActivity"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Name:"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="34dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Passwort"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="34dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Passwort wiederholen:"
android:id="@+id/textView3"
android:layout_below="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="34dp"
android:layout_alignRight="@+id/textView5"
android:layout_alignEnd="@+id/textView5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="E-Mail:"
android:id="@+id/textView4"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="E-Mail wiederholen"
android:id="@+id/textView5"
android:layout_marginTop="46dp"
android:layout_below="@+id/et_email"
android:layout_alignLeft="@+id/cb_agb"
android:layout_alignStart="@+id/cb_agb" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AGBŽs gelesen und akzeptiert"
android:id="@+id/cb_agb"
android:layout_marginTop="53dp"
android:checked="false"
android:layout_below="@+id/textView5"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:id="@+id/et_name"
android:layout_above="@+id/textView2"
android:layout_toEndOf="@+id/textView3"
android:layout_toRightOf="@+id/textView3" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/et_password"
android:layout_above="@+id/textView3"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignLeft="@+id/et_password_2"
android:layout_alignStart="@+id/et_password_2" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/et_password_2"
android:layout_alignBottom="@+id/textView3"
android:layout_alignLeft="@+id/et_name"
android:layout_alignStart="@+id/et_name" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/et_email"
android:layout_alignBottom="@+id/textView4"
android:layout_alignLeft="@+id/et_password_2"
android:layout_alignStart="@+id/et_password_2" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:ems="10"
android:id="@+id/et_email_2"
android:layout_above="@+id/cb_agb"
android:layout_alignLeft="@+id/et_email"
android:layout_alignStart="@+id/et_email" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Absenden"
android:id="@+id/btn_submit"
android:layout_alignTop="@+id/cb_agb"
android:layout_alignRight="@+id/et_name"
android:layout_alignEnd="@+id/et_name" />
</RelativeLayout>
activity_login.xml:
Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="lukas.myapplication.LoginActivity">
<!-- Login progress -->
<ProgressBar
android:id="@+id/login_progress" style="?android:attr/actionBarTabStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:visibility="gone" />
<ScrollView android:id="@+id/login_form" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:id="@+id/email_login_form" android:layout_width="match_parent"
android:layout_height="wrap_content" android:orientation="vertical">
<android.support.design.widget.TextInputLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView android:id="@+id/email" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="@string/prompt_email"
android:inputType="textEmailAddress" android:maxLines="1"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/password" android:layout_width="match_parent"
android:layout_height="wrap_content" android:hint="Passwort"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified" android:inputType="textPassword"
android:maxLines="1" android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<Button android:id="@+id/email_sign_in_button" style="?android:textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="Anmelden"
android:textStyle="bold" />
<Button
android:id="@+id/registering_button"
android:layout_width="120dp"
android:layout_marginLeft="200dp"
android:layout_height="match_parent"
android:layout_marginTop="150dp"
android:text="Registrieren"
android:layout_gravity="right" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-35dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Noch kein Konto?"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>