Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:50:31+00:00 2026-06-01T22:50:31+00:00

Hi I created the files using the android hive example and I seem to

  • 0

Hi I created the files using the android hive example and I seem to be getting the following error I cannot figure out. My UI works fine its just whenever I click on the login button or the register button it forces a close plese help?

04-13 14:41:31.911: D/dalvikvm(431): GC_FOR_MALLOC freed 3881 objects / 200672 bytes in 88ms
04-13 14:41:32.110: E/JSON(431): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
04-13 14:41:32.110: E/JSON(431): <html><head>
04-13 14:41:32.110: E/JSON(431): <title>404 Not Found</title>
04-13 14:41:32.110: E/JSON(431): </head><body>
04-13 14:41:32.110: E/JSON(431): <h1>Not Found</h1>
04-13 14:41:32.110: E/JSON(431): <p>The requested URL /android_login_api/ was not found on >     this server.</p>
04-13 14:41:32.110: E/JSON(431): </body></html>
04-13 14:41:32.120: E/JSON Parser(431): Error parsing data org.json.JSONException: Value <!>     DOCTYPE of type java.lang.String cannot be converted to JSONObject
04-13 14:41:32.131: D/AndroidRuntime(431): Shutting down VM
04-13 14:41:32.131: W/dalvikvm(431): threadid=1: thread exiting with uncaught exception >     >     (group=0x4001d800)
04-13 14:41:32.131: E/AndroidRuntime(431): FATAL EXCEPTION: main
04-13 14:41:32.131: E/AndroidRuntime(431): java.lang.NullPointerException
04-13 14:41:32.131: E/AndroidRuntime(431):    at com.screenssample.LoginActivity$1.onClick>     >     (LoginActivity.java:59)
04-13 14:41:32.131: E/AndroidRuntime(431):    at android.view.View.performClick(View.java:2408)
04-13 14:41:32.131: E/AndroidRuntime(431):    at android.view.View$PerformClick.run>     >     >     (View.java:8816)
04-13 14:41:32.131: E/AndroidRuntime(431):    at android.os.Handler.handleCallback>     >     >     (Handler.java:587)
04-13 14:41:32.131: E/AndroidRuntime(431):    at android.os.Handler.dispatchMessage>     >     >     (Handler.java:92)
04-13 14:41:32.131: E/AndroidRuntime(431):    at android.os.Looper.loop(Looper.java:123)
04-13 14:41:32.131: E/AndroidRuntime(431):    at android.app.ActivityThread.main>     >     >     (ActivityThread.java:4627)
04-13 14:41:32.131: E/AndroidRuntime(431):    at java.lang.reflect.Method.invokeNative(Native >     Method)
04-13 14:41:32.131: E/AndroidRuntime(431):    at java.lang.reflect.Method.invoke>     >     >     (Method.java:521)
04-13 14:41:32.131: E/AndroidRuntime(431):    at om.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-13 14:41:32.131: E/AndroidRuntime(431):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-13 14:41:32.131: E/AndroidRuntime(431):    at dalvik.system.NativeStart.main(Native Method)

The LoginActivity code reads

package com.screenssample;

import java.util.HashMap; 

import org.json.JSONException; 
import org.json.JSONObject; 

import android.app.Activity; 
import android.content.Intent; 
import android.os.Bundle; 
import android.util.Log; 
import android.view.View; 
import android.widget.Button; 
import android.widget.EditText; 
import android.widget.TextView; 

import com.screenssample.DatabaseHandler; 
import com.screenssample.UserFunctions; 

public class LoginActivity extends Activity { 
    Button btnLogin; 
    Button btnLinkToRegister; 
    EditText inputEmail; 
    EditText inputPassword; 
   TextView loginErrorMsg; 
// JSON Response node names 
private static String KEY_SUCCESS = "success"; 
private static String KEY_ERROR = "error"; 
private static String KEY_ERROR_MSG = "error_msg"; 
private static String KEY_UID = "uid"; 
private static String KEY_NAME = "name"; 
private static String KEY_EMAIL = "email"; 
private static String KEY_CREATED_AT = "created_at"; 

@Override
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.login); 

    // Importing all assets like buttons, text fields 
    inputEmail = (EditText) findViewById(R.id.loginEmail); 
    inputPassword = (EditText) findViewById(R.id.loginPassword); 
    btnLogin = (Button) findViewById(R.id.btnLogin); 
    btnLinkToRegister = (Button) findViewById(R.id.btnLinkToRegisterScreen); 
    loginErrorMsg = (TextView) findViewById(R.id.login_error); 

    // Login button Click Event 
    btnLogin.setOnClickListener(new View.OnClickListener() { 

        public void onClick(View view) { 
            String email = inputEmail.getText().toString(); 
            String password = inputPassword.getText().toString(); 
            UserFunctions userFunction = new UserFunctions(); 
            JSONObject json = userFunction.loginUser(email, password); 

            // check for login response 
            try { 
                if (json.getString(KEY_SUCCESS) != null) { 
                    loginErrorMsg.setText(""); 
                    String res = json.getString(KEY_SUCCESS); 
                    if(Integer.parseInt(res) == 1){ 
                        // user successfully logged in 
                        // Store user details in SQLite Database 
                        DatabaseHandler db = new DatabaseHandler(getApplicationContext()); 
                        JSONObject json_user = json.getJSONObject("user"); 

                        // Clear all previous data in database 
                        userFunction.logoutUser(getApplicationContext()); 
                        db.addUser(json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json.getString(KEY_UID), json_user.getString(KEY_CREATED_AT));                         

                        // Launch Dashboard Screen 
                        Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class); 

                        // Close all views before launching Dashboard 
                        dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
                        startActivity(dashboard); 

                        // Close Login Screen 
                        finish(); 
                    }else{ 
                        // Error in login 
                        loginErrorMsg.setText("Incorrect username/password"); 
                    } 
                } 
            } catch (JSONException e) { 
                e.printStackTrace(); 
            } 
        } 
    }); 

    // Link to Register Screen 
    btnLinkToRegister.setOnClickListener(new View.OnClickListener() { 

        public void onClick(View view) { 
            Intent i = new Intent(getApplicationContext(), 
                    RegisterActivity.class); 
            startActivity(i); 
            finish(); 
        } 
    }); 
} 

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:50:32+00:00Added an answer on June 1, 2026 at 10:50 pm
     E/JSON Parser(431): Error parsing data org.json.JSONException: Value <!>     DOCTYPE of type java.lang.String cannot be converted to JSONObject
    

    It seems json.getJSONObject(“user”); returning XML not JSONObject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a directory in android internal storage using following lines: File directory
I've created Android application using Maps API V3 on WebView and local HTML files(contained
I am working on Moodle 2.2.1 and have created dynamic.csv files using certain queries.
I've created a batch script to automatically update some files using wget for Windows.
I used Firebug to inspect the HTML my php(using wordpress) files created. According to
Where does Railo store files created by when using the file attribute? I.e. <cflog
We are using JBoss 6, the jna tmp files are created but not deleted.
I'm using Tika parser to index my files into Solr. I created my own
I have created an application using Adobe Flex. I took all the files from
I have recently just created Java project using Eclipse that requires 2 JAR files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.