-1

I have been implementing the code of login and registration app from http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/ I copy pasted the code along with following the instructions but I am still getting the registration error : null in the log cat on pressing the register button. The php files(ex: register.php) are displaying {"error":true,"error_msg":"Required parameters (name, email or password) is missing!"} , that means they are working fine. I am using xampp and have kept the files in htdocs. I have checked various url in Appconfig.java such as 127.0.0.1, 10.0.2.2:8080, 10.0.2.2:80, and the ip of my computer system from ipconfig cmd, but still getting same error. Here is the code of Appconfig.java.

  package com.urjapawar.hackathon1;
     public class AppConfig {
        // Server user login url
        public static String URL_LOGIN ="http://192.168.2.5/android_login_api/login.php";

        // Server user register url
        public static String URL_REGISTER = "http://192.168.2.5/android_login_api/register.php";
}

and here is the code of Android manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.urjapawar.hackathon1" >

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:name="com.urjapawar.hackathon1.AppController"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".LoginActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop"
        android:windowSoftInputMode="adjustPan" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop" />
    <activity
        android:name=".RegisterActivity"
        android:label="@string/title_activity_register"
        android:launchMode="singleTop"
        android:windowSoftInputMode="adjustPan" >
    </activity>
</application>

Also I have checked correctly username and password in config.php, Please help.

3
  • are you passing name, email and password while registering?
    – Ravi
    Feb 27, 2016 at 12:39
  • yup, I fixed it, Just need to replace 192.168.2.5 by 192.168.2.5:80
    – Urja Pawar
    Feb 27, 2016 at 13:52
  • can any one please tell me where are the changes to be made for checking password while logging in. Please visit updated code, I am not able to figure out the change androidhive.info/2012/01/…
    – Urja Pawar
    Mar 1, 2016 at 12:22

1 Answer 1

0

I just need to replace 192.168.2.5 with 192.168.2.5:80

Not the answer you're looking for? Browse other questions tagged or ask your own question.