• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Need help with making an app

I'm have to make an app for a school project / seminar paper and I'm slightly running out of time. The problem is that i have spent the last day trying to establish a connection between the app and an online database for login and register purposes, but now the app will barely start and things that worked before just don't anymore. I'd like someone to help me fix this thing so I can actually continue working on it. Help beyond that would be actually appreciated too :D
 
Please post your code (use [code][/code] tags) and describe the problem. If the app crashes, also post the stack trace from the Logcat output.

I think this is all the code that has anything to do with logging in stuff... I was following a tutorial but it was at the end that I have noticed that the HTTP Client and others are deprecated so i added some stuff to the APP gradle. I think it it would be easier for someone to rewrite it that to fix this code :D

ServerRequest.java
Code:
public class ServersRequests {
    ProgressDialog progressDialog;
    public static final int CONNECTION_TIMEOUT = 15000;
    public static final String  SERVER_ADDRESS="";

    public ServersRequests(Context context){

        progressDialog = new ProgressDialog(context);
        progressDialog.setCancelable(false);
        progressDialog.setTitle("Processing");
        progressDialog.setMessage("Please wait..");

    }
    public void storeDataInBackground(User user, GetUserCallback callback){

        progressDialog.show();
        new StoreDataAsyncTask(user, callback).execute();
    }

    public void fetchDataInBackground (User user, GetUserCallback callback){
        progressDialog.show();
        new FetchDataAsyncTask(user,callback).execute();
    }


    public class StoreDataAsyncTask extends AsyncTask<Void, Void, Void> {

        User user;
        GetUserCallback callback;

        public StoreDataAsyncTask (User user, GetUserCallback callback) {

            this.user = user;
            this.callback = callback;
        }
        @Override
        protected Void doInBackground(Void... voids) {
            ArrayList<NameValuePair> data_to_send= new ArrayList<>();
            data_to_send.add(new BasicNameValuePair("Name", user.name));
            data_to_send.add(new BasicNameValuePair("Last Name", user.last_name));
            data_to_send.add(new BasicNameValuePair("Email", user.email));
            data_to_send.add(new BasicNameValuePair("Password", user.password));

            HttpParams httpRequestParams = new BasicHttpParams();
            HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT);
            HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT);

            HttpClient client = new DefaultHttpClient(httpRequestParams);
            HttpPost post = new HttpPost(SERVER_ADDRESS + "register.php" );
            try {
                post.setEntity(new UrlEncodedFormEntity(data_to_send));
                client.execute(post);
            }
            catch (Exception e){
                e.printStackTrace();
            }
            return null;
        }

        @Override
        protected void onPostExecute(Void aVoid) {
            progressDialog.dismiss();
            callback.done(null);
            super.onPostExecute(aVoid);
        }

    }

    public class FetchDataAsyncTask extends AsyncTask<Void, Void, User>{

        User user;
        GetUserCallback callback;

        public FetchDataAsyncTask (User user, GetUserCallback callback){

            this.user=user;
            this.callback=callback;
        }

        @Override
        protected User doInBackground(Void... voids) {
            ArrayList<NameValuePair> data_to_send= new ArrayList<>();
            data_to_send.add(new BasicNameValuePair("Email", user.email));
            data_to_send.add(new BasicNameValuePair("Password", user.password));

            HttpParams httpRequestParams = new BasicHttpParams();
            HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT);
            HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT);

            HttpClient client = new DefaultHttpClient(httpRequestParams);
            HttpPost post = new HttpPost(SERVER_ADDRESS + "fetchUserData.php" );

            User returnedUser = null;

            try {
                post.setEntity(new UrlEncodedFormEntity(data_to_send));
                HttpResponse httpResponse = client.execute(post);

                HttpEntity entity = httpResponse.getEntity();
                String result= EntityUtils.toString(entity);

                JSONObject jsonObject= new JSONObject(result);
                if(jsonObject.length() == 0){

                    returnedUser = null;
                }
                else{
                    String name,last_name;
                    name=null;
                    last_name=null;

                    if(jsonObject.has("name"))
                        name=jsonObject.getString("name");
                    if(jsonObject.has("last_name"))
                        last_name=jsonObject.getString("last_name");

                    returnedUser = new User(name,last_name, user.email,user.password );



                }
            }
            catch (Exception e){
                e.printStackTrace();
            }
            return returnedUser;
        }

        @Override
        protected void onPostExecute(User returnedUser) {
            progressDialog.dismiss();
            callback.done(returnedUser);
            super.onPostExecute(returnedUser);
        }
    }
}

GetUserCallback.java
Code:
public interface GetUserCallback {

    public abstract void done(User returnedUser);
}


LocalDatabase.java

Code:
public class LocalDatabase {

    public static final String SP_NAME = "UserDetails";
    SharedPreferences localDatabase;
    public LocalDatabase(Context context){

        localDatabase = context.getSharedPreferences(SP_NAME, 0);
    }

    public void storeData(User user){
        SharedPreferences.Editor spEditor = localDatabase.edit();
        spEditor.putString("Name", user.name);
        spEditor.putString("Last Name", user.last_name);
        spEditor.putString("Email", user.email);
        spEditor.putString("Password", user.password);
        spEditor.apply();
    }
    public User getLoggedInUser(){

        String name= localDatabase.getString("Name", "");
        String last_name= localDatabase.getString("Last Name", "");
        String email= localDatabase.getString("Email", "");
        String password= localDatabase.getString("Password", "");

        User storedUser = new User(name, last_name, email, password);
        return storedUser;
    }

    public void setUserLoggedIn(boolean loggedIn){

        SharedPreferences.Editor spEditor = localDatabase.edit();
        spEditor.putBoolean("loggedIn", loggedIn);
        spEditor.apply();
    }
    public boolean getUserLoggedIn(){

        return localDatabase.getBoolean("loggedIn", false);

    }

    public void clearData(){

        SharedPreferences.Editor spEditor = localDatabase.edit();
        spEditor.clear();
        spEditor.apply();


    }
}

LoginActivity.java

Code:
 EditText etPassword, etEmail;
    LocalDatabase localDatabase;

    public LoginActivity(){

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);


        etPassword = (EditText) findViewById(R.id.etPassword);
        etEmail = (EditText) findViewById(R.id.etEmail);
        localDatabase = new LocalDatabase(this);

        Button bLogin = (Button)findViewById(R.id.button);
        TextView tvRegister= (TextView)findViewById((R.id.tvRegister));
    }

    public void onRegisterClick(View view){

        Intent intent = new Intent("ninja.god_father_o7.projectx.RegisterActivity");
        startActivity(intent);

    }
    public void onLoginClick(View view){

        String email = etEmail.getText().toString();
        String password = etPassword.getText().toString();

        User user = new User(email, password);
        this.authenticate(user);
    }

    private void authenticate (User user){

        ServersRequests serversRequests = new ServersRequests(this);
        serversRequests.fetchDataInBackground(user, new GetUserCallback() {
            @Override
            public void done(User returnedUser) {


                if(returnedUser == null){

                    //show error
                    AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
                    builder.setMessage("Username and Password don't match or don't exist");
                    builder.setPositiveButton("OK", null);
                    builder.show();
                }
                else{

                    localDatabase.storeData(returnedUser);
                    localDatabase.setUserLoggedIn(true);

                    Intent intent = new Intent("ninja.god_father_o7.projectx.UserAreaActivity");
                    startActivity(intent);
                }
            }
        });
    }

registerActivity

Code:
 EditText etName, etLastName, etEmail, etPassword, etConPassowrd;

    @Override
    protected void onCreate (Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);

        etName= (EditText)findViewById(R.id.etName);
        etLastName= (EditText)findViewById(R.id.etLastName);
        etEmail= (EditText)findViewById(R.id.etEmail);
        etPassword= (EditText)findViewById(R.id.etPassword);
        etConPassowrd= (EditText)findViewById(R.id.etCPass);


    }

    public void onRegisterClick (View view){


        String name = etName.getText().toString();
        String lastName = etLastName.getText().toString();
        String email = etEmail.getText().toString();
        String password = etPassword.getText().toString();
        String conPassword = etConPassowrd.getText().toString();

        User user;

        if(password.equals(conPassword)) {

            user = new User(name, lastName, email, password);
            ServersRequests serversRequests = new ServersRequests(this);
            serversRequests.storeDataInBackground(user, new GetUserCallback() {
                @Override
                public void done(User returnedContact) {
                    Intent intent = new Intent("ninja.god_father_o7.projectx.LoginActivity");
                    startActivity(intent);
                }
            });

        }
        else{

            Toast.makeText(this, "Passwords don't match!",Toast.LENGTH_LONG).show();
        }

        Intent intent = new Intent ("ninja.god_father_o7.projectx.LoginActivity");
        startActivity(intent);

register .php

Code:
$con = mysqli_connect("","","", "");
   
    $name = $_POST("name");
    $last_name = $_POST("last_name");
    $email = $_POST("email");
    $password = $_POST("password");

    $insertquery = mysqli_prepare($con, "INSERT INTO users(name, last_name, email, password) VALUES(?,?,?,?)");
    mysqli_stmt_bind_param($insertquery, "ssss", $name, $last_name, $email, $password);
    mysqli_stmt_execute($insertquery);
   
    mysqli_stmt_close($insertquery);
   
    mysqli_close($con);

fetchUserData.php

Code:
$con = mysqli_connect("","","", "");

    $email = $_POST("email");
    $password = $_POST("password");
   
    $selectquery = mysqli_prepare($con, "SELECT * FROM users WHERE email=? AND password=? ");
    mysqli_stmt_bind_param($selectquery, "ss". $email, $password);
    mysqli_stmt_execute($selectquery);
   
    mysqli_stmt_store_result($selectquery):
    mysqli_stmt_bind_result($selectquery, $id, $name, $last_name, $email, $password);
   
    $user = array();
   
    while(mysqli_stmt_fetch(selectquery))
    {
        $user[name]= $name;
        $user[last_name]= $last_name;
        $user[email]= $email;
        $user[password]= $password;
    }
   
    echo json_encode($user);
   
   
    mysqli_stmt_close($selectquery);
   
   
    mysqli_close($con);
 
Upvote 0
You need to be more specific with your question. What exactly doesn't work?

I don't acually remember what errors were poping out as I have removed this code from my app so I could procede with doing other things, but I remember that the app wouldn't start on the launcher activity (LoginActivity) and if I pressed any of the buttons the app crashed. When I achieved that the app started with LoginActivity again I manualy put a user into the database, but when i put the email and password into the app it would return

Code:
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
                    builder.setMessage("Username and Password don't match or don't exist")

and if I pressed the Register here text the app would also crash
 
Upvote 0
Ok so as it stands, with the code you have, what is the immediate problem? If the app crashes, please post the stack trace from the Logcat output.
Code:
04-17 16:13:28.079 9113-9113/ninja.god_father_o7.projectx E/AndroidRuntime: FATAL EXCEPTION: main
                                                                            Process: ninja.god_father_o7.projectx, PID: 9113
                                                                            android.content.ActivityNotFoundException: No Activity found to handle Intent { act=ninja.god_father_o7.LoginActivity }
                                                                                at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
                                                                                at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
                                                                                at android.app.Activity.startActivityForResult(Activity.java:3917)
                                                                                at android.app.Activity.startActivityForResult(Activity.java:3877)
                                                                                at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:843)
                                                                                at android.app.Activity.startActivity(Activity.java:4200)
                                                                                at android.app.Activity.startActivity(Activity.java:4168)
                                                                                at ninja.god_father_o7.projectx.RegisterActivity$1.onClick(RegisterActivity.java:25)
                                                                                at android.view.View.performClick(View.java:5198)
                                                                                at android.view.View$PerformClick.run(View.java:21147)
                                                                                at android.os.Handler.handleCallback(Handler.java:739)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                at android.os.Looper.loop(Looper.java:148)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-17 16:13:29.800 9113-9113/ninja.god_father_o7.projectx I/Process: Sending signal. PID: 9113 SIG: 9
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:464)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:142)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:169)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:124)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:366)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:492)
04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:470)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at ninja.god_father_o7.projectx.ServersRequests$FetchDataAsyncTask.doInBackground(ServersRequests.java:118)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at ninja.god_father_o7.projectx.ServersRequests$FetchDataAsyncTask.doInBackground(ServersRequests.java:90)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.lang.Thread.run(Thread.java:818)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err: Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at libcore.io.Posix.android_getaddrinfo(Native Method)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:55)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     ... 17 more
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err: Caused by: android.system.ErrnoException: android_getaddrinfo failed: EACCES (Permission denied)
04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     ... 20 more
04-17 16:16:02.620 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
04-17 16:16:02.620 9639-9660/ninja.god_father_o7.projectx W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1bd2420, error=EGL_SUCCESS
04-17 16:16:02.631 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373140
04-17 16:16:02.688 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
04-17 16:16:02.688 9639-9660/ninja.god_father_o7.projectx W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1bd2100, error=EGL_SUCCESS
04-17 16:16:07.188 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373220
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:464)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:142)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:169)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:124)
04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:366)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:492)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:470)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at ninja.god_father_o7.projectx.ServersRequests$FetchDataAsyncTask.doInBackground(ServersRequests.java:118)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at ninja.god_father_o7.projectx.ServersRequests$FetchDataAsyncTask.doInBackground(ServersRequests.java:90)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.lang.Thread.run(Thread.java:818)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err: Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at libcore.io.Posix.android_getaddrinfo(Native Method)
04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:55)
04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     ... 17 more
04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err: Caused by: android.system.ErrnoException: android_getaddrinfo failed: EACCES (Permission denied)
04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     ... 20 more
04-17 16:18:12.170 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
04-17 16:18:12.170 9639-9660/ninja.god_father_o7.projectx W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1bbc2c0, error=EGL_SUCCESS
04-17 16:18:12.179 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373140
04-17 16:18:12.221 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
04-17 16:18:12.221 9639-9660/ninja.god_father_o7.projectx W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1bbc060, error=EGL_SUCCESS
04-17 16:18:13.528 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae3731b0
04-17 16:18:14.287 9639-13845/ninja.god_father_o7.projectx W/System.err: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
04-17 16:18:14.287 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:464)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:142)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:169)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:124)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:366)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:492)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:470)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at ninja.god_father_o7.projectx.ServersRequests$FetchDataAsyncTask.doInBackground(ServersRequests.java:118)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at ninja.god_father_o7.projectx.ServersRequests$FetchDataAsyncTask.doInBackground(ServersRequests.java:90)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.lang.Thread.run(Thread.java:818)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err: Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at libcore.io.Posix.android_getaddrinfo(Native Method)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:55)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     ... 17 more
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err: Caused by: android.system.ErrnoException: android_getaddrinfo failed: EACCES (Permission denied)
04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     ... 20 more
04-17 16:18:14.304 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
04-17 16:18:14.304 9639-9660/ninja.god_father_o7.projectx W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1bbca40, error=EGL_SUCCESS
04-17 16:18:14.313 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae3731b0
04-17 16:18:14.353 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
04-17 16:18:14.353 9639-9660/ninja.god_father_o7.projectx W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa1bbca60, error=EGL_SUCCESS
04-17 16:18:15.274 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373220
04-17 16:23:08.070 9639-9639/ninja.god_father_o7.projectx D/AndroidRuntime: Shutting down VM
04-17 16:23:08.070 9639-9639/ninja.god_father_o7.projectx E/AndroidRuntime: FATAL EXCEPTION: main
                                                                            Process: ninja.god_father_o7.projectx, PID: 9639
                                                                            android.content.ActivityNotFoundException: No Activity found to handle Intent { act=ninja.god_father_o7.LoginActivity }
                                                                                at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
                                                                                at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
                                                                                at android.app.Activity.startActivityForResult(Activity.java:3917)
                                                                                at android.app.Activity.startActivityForResult(Activity.java:3877)
                                                                                at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:843)
                                                                                at android.app.Activity.startActivity(Activity.java:4200)
                                                                                at android.app.Activity.startActivity(Activity.java:4168)
                                                                                at ninja.god_father_o7.projectx.RegisterActivity$1.onClick(RegisterActivity.java:25)
                                                                                at android.view.View.performClick(View.java:5198)
                                                                                at android.view.View$PerformClick.run(View.java:21147)
                                                                                at android.os.Handler.handleCallback(Handler.java:739)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                at android.os.Looper.loop(Looper.java:148)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)



app crashes when i click on register button in RegisterActivity, when i click login in LoginActivity I get the same error as i wrote in the post above. i still do not know where the problem is.... it could be in the java code or in the PHP
 
Upvote 0
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones