Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从数据库登录的Android应用程序_Android_Login - Fatal编程技术网

从数据库登录的Android应用程序

从数据库登录的Android应用程序,android,login,Android,Login,我有我们俱乐部球员的数据库 我想为它创建一个应用程序 例如,每个玩家只有一个用户名和密码以及一个管理员 管理员可以添加新玩家 这就是我的登录活动 有人能帮我吗?如何将应用程序与数据库链接 谢谢。这不完全是您的登录活动。这是你的布局文件。您的登录活动将是扩展活动的java文件 基本上,你必须做到以下几点 单击按钮时,您必须从编辑文本中获取用户名和密码,确保它们不是空的或无效的。然后,您将旋转一个异步任务,该任务将通过API向应用程序服务器发出请求。PHP、ASP、RubyonRails。不

我有我们俱乐部球员的数据库

我想为它创建一个应用程序

例如,每个玩家只有一个用户名和密码以及一个管理员

管理员可以添加新玩家

这就是我的登录活动


有人能帮我吗?如何将应用程序与数据库链接


谢谢。

这不完全是您的登录活动。这是你的布局文件。您的登录活动将是扩展活动的java文件

基本上,你必须做到以下几点

单击按钮时,您必须从编辑文本中获取用户名和密码,确保它们不是空的或无效的。然后,您将旋转一个异步任务,该任务将通过API向应用程序服务器发出请求。PHP、ASP、RubyonRails。不管你决定用什么。然后,应用服务器将向数据库发出请求,并让用户登录

改装是一个很好的库,可以向服务器发出基于REST的请求

在此期间,您可以向用户显示progressDialog,以显示他正在等待返回结果


返回结果后,您可以将用户登录到应用程序,或显示无效密码或电子邮件的错误。

您所有的代码都是这样吗?您是否编写了web服务代码?没有,仅此代码登录
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:padding="10dip" >         <!--  View Title Label -->
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dip"
        android:text="LOGIN"
        android:textSize="25dip"
        android:textStyle="bold" />       <!--  Email Label -->
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Email" />       <!--  Email TextField -->
    <EditText
        android:id="@+id/loginEmail"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
          <!--  Password Label -->
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dip"
        android:text="Password" />        <!--  Password TextField -->
    <EditText
        android:id="@+id/loginPassword"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:password="true" />

    <!--  Error message -->
    <TextView android:id="@+id/login_error"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:textColor="#e30000"
              android:padding="10dip"
              android:textStyle="bold"/>

  <!--  Login Button -->        
    <Button
        android:id="@+id/btnLogin"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dip"
        android:text="Login" />

    <!--  Link to Registration Screen -->
</LinearLayout>