1. Download our Official Android App: Forums for Android!

Apps Need help with making an app

Discussion in 'Android Development' started by DieselWeasel, Apr 16, 2016.

  1. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male
    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
     

    Advertisement

  2. Thom

    Thom  
    VIP Member
    Rank:
     #21
    Points:
    1,318
    Posts:
    12,016
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    12,016
    4,978
    1,318
    Male
    Software Developer
    Keene, NH USA
    Welcome to Android Forums.

    This app is something you created using Java? What development environment are you using?

    ... Thom
     
  3. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male
    I'm using Android studio and its IDE
     
  4. Thom

    Thom  
    VIP Member
    Rank:
     #21
    Points:
    1,318
    Posts:
    12,016
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    12,016
    4,978
    1,318
    Male
    Software Developer
    Keene, NH USA
    This thread was moved to this forum where development subjects are discussed.

    ... Thom
     
  5. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
    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.
     
  6. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male
    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 (Text):
    1.  
    2. public class ServersRequests {
    3.     ProgressDialog progressDialog;
    4.     public static final int CONNECTION_TIMEOUT = 15000;
    5.     public static final String  SERVER_ADDRESS="";
    6.  
    7.     public ServersRequests(Context context){
    8.  
    9.         progressDialog = new ProgressDialog(context);
    10.         progressDialog.setCancelable(false);
    11.         progressDialog.setTitle("Processing");
    12.         progressDialog.setMessage("Please wait..");
    13.  
    14.     }
    15.     public void storeDataInBackground(User user, GetUserCallback callback){
    16.  
    17.         progressDialog.show();
    18.         new StoreDataAsyncTask(user, callback).execute();
    19.     }
    20.  
    21.     public void fetchDataInBackground (User user, GetUserCallback callback){
    22.         progressDialog.show();
    23.         new FetchDataAsyncTask(user,callback).execute();
    24.     }
    25.  
    26.  
    27.     public class StoreDataAsyncTask extends AsyncTask<Void, Void, Void> {
    28.  
    29.         User user;
    30.         GetUserCallback callback;
    31.  
    32.         public StoreDataAsyncTask (User user, GetUserCallback callback) {
    33.  
    34.             this.user = user;
    35.             this.callback = callback;
    36.         }
    37.         @Override
    38.         protected Void doInBackground(Void... voids) {
    39.             ArrayList<NameValuePair> data_to_send= new ArrayList<>();
    40.             data_to_send.add(new BasicNameValuePair("Name", user.name));
    41.             data_to_send.add(new BasicNameValuePair("Last Name", user.last_name));
    42.             data_to_send.add(new BasicNameValuePair("Email", user.email));
    43.             data_to_send.add(new BasicNameValuePair("Password", user.password));
    44.  
    45.             HttpParams httpRequestParams = new BasicHttpParams();
    46.             HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT);
    47.             HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT);
    48.  
    49.             HttpClient client = new DefaultHttpClient(httpRequestParams);
    50.             HttpPost post = new HttpPost(SERVER_ADDRESS + "register.php" );
    51.             try {
    52.                 post.setEntity(new UrlEncodedFormEntity(data_to_send));
    53.                 client.execute(post);
    54.             }
    55.             catch (Exception e){
    56.                 e.printStackTrace();
    57.             }
    58.             return null;
    59.         }
    60.  
    61.         @Override
    62.         protected void onPostExecute(Void aVoid) {
    63.             progressDialog.dismiss();
    64.             callback.done(null);
    65.             super.onPostExecute(aVoid);
    66.         }
    67.  
    68.     }
    69.  
    70.     public class FetchDataAsyncTask extends AsyncTask<Void, Void, User>{
    71.  
    72.         User user;
    73.         GetUserCallback callback;
    74.  
    75.         public FetchDataAsyncTask (User user, GetUserCallback callback){
    76.  
    77.             this.user=user;
    78.             this.callback=callback;
    79.         }
    80.  
    81.         @Override
    82.         protected User doInBackground(Void... voids) {
    83.             ArrayList<NameValuePair> data_to_send= new ArrayList<>();
    84.             data_to_send.add(new BasicNameValuePair("Email", user.email));
    85.             data_to_send.add(new BasicNameValuePair("Password", user.password));
    86.  
    87.             HttpParams httpRequestParams = new BasicHttpParams();
    88.             HttpConnectionParams.setConnectionTimeout(httpRequestParams, CONNECTION_TIMEOUT);
    89.             HttpConnectionParams.setSoTimeout(httpRequestParams, CONNECTION_TIMEOUT);
    90.  
    91.             HttpClient client = new DefaultHttpClient(httpRequestParams);
    92.             HttpPost post = new HttpPost(SERVER_ADDRESS + "fetchUserData.php" );
    93.  
    94.             User returnedUser = null;
    95.  
    96.             try {
    97.                 post.setEntity(new UrlEncodedFormEntity(data_to_send));
    98.                 HttpResponse httpResponse = client.execute(post);
    99.  
    100.                 HttpEntity entity = httpResponse.getEntity();
    101.                 String result= EntityUtils.toString(entity);
    102.  
    103.                 JSONObject jsonObject= new JSONObject(result);
    104.                 if(jsonObject.length() == 0){
    105.  
    106.                     returnedUser = null;
    107.                 }
    108.                 else{
    109.                     String name,last_name;
    110.                     name=null;
    111.                     last_name=null;
    112.  
    113.                     if(jsonObject.has("name"))
    114.                         name=jsonObject.getString("name");
    115.                     if(jsonObject.has("last_name"))
    116.                         last_name=jsonObject.getString("last_name");
    117.  
    118.                     returnedUser = new User(name,last_name, user.email,user.password );
    119.  
    120.  
    121.  
    122.                 }
    123.             }
    124.             catch (Exception e){
    125.                 e.printStackTrace();
    126.             }
    127.             return returnedUser;
    128.         }
    129.  
    130.         @Override
    131.         protected void onPostExecute(User returnedUser) {
    132.             progressDialog.dismiss();
    133.             callback.done(returnedUser);
    134.             super.onPostExecute(returnedUser);
    135.         }
    136.     }
    137. }
    138.  
    GetUserCallback.java
    Code (Text):
    1.  
    2.  
    3. public interface GetUserCallback {
    4.  
    5.     public abstract void done(User returnedUser);
    6. }
    7.  
    8.  

    LocalDatabase.java

    Code (Text):
    1.  
    2. public class LocalDatabase {
    3.  
    4.     public static final String SP_NAME = "UserDetails";
    5.     SharedPreferences localDatabase;
    6.     public LocalDatabase(Context context){
    7.  
    8.         localDatabase = context.getSharedPreferences(SP_NAME, 0);
    9.     }
    10.  
    11.     public void storeData(User user){
    12.         SharedPreferences.Editor spEditor = localDatabase.edit();
    13.         spEditor.putString("Name", user.name);
    14.         spEditor.putString("Last Name", user.last_name);
    15.         spEditor.putString("Email", user.email);
    16.         spEditor.putString("Password", user.password);
    17.         spEditor.apply();
    18.     }
    19.     public User getLoggedInUser(){
    20.  
    21.         String name= localDatabase.getString("Name", "");
    22.         String last_name= localDatabase.getString("Last Name", "");
    23.         String email= localDatabase.getString("Email", "");
    24.         String password= localDatabase.getString("Password", "");
    25.  
    26.         User storedUser = new User(name, last_name, email, password);
    27.         return storedUser;
    28.     }
    29.  
    30.     public void setUserLoggedIn(boolean loggedIn){
    31.  
    32.         SharedPreferences.Editor spEditor = localDatabase.edit();
    33.         spEditor.putBoolean("loggedIn", loggedIn);
    34.         spEditor.apply();
    35.     }
    36.     public boolean getUserLoggedIn(){
    37.  
    38.         return localDatabase.getBoolean("loggedIn", false);
    39.  
    40.     }
    41.  
    42.     public void clearData(){
    43.  
    44.         SharedPreferences.Editor spEditor = localDatabase.edit();
    45.         spEditor.clear();
    46.         spEditor.apply();
    47.  
    48.  
    49.     }
    50. }
    51.  
    52.  
    LoginActivity.java

    Code (Text):
    1.  
    2.  EditText etPassword, etEmail;
    3.     LocalDatabase localDatabase;
    4.  
    5.     public LoginActivity(){
    6.  
    7.     }
    8.  
    9.     @Override
    10.     protected void onCreate(Bundle savedInstanceState) {
    11.         super.onCreate(savedInstanceState);
    12.         setContentView(R.layout.activity_login);
    13.  
    14.  
    15.         etPassword = (EditText) findViewById(R.id.etPassword);
    16.         etEmail = (EditText) findViewById(R.id.etEmail);
    17.         localDatabase = new LocalDatabase(this);
    18.  
    19.         Button bLogin = (Button)findViewById(R.id.button);
    20.         TextView tvRegister= (TextView)findViewById((R.id.tvRegister));
    21.     }
    22.  
    23.     public void onRegisterClick(View view){
    24.  
    25.         Intent intent = new Intent("ninja.god_father_o7.projectx.RegisterActivity");
    26.         startActivity(intent);
    27.  
    28.     }
    29.     public void onLoginClick(View view){
    30.  
    31.         String email = etEmail.getText().toString();
    32.         String password = etPassword.getText().toString();
    33.  
    34.         User user = new User(email, password);
    35.         this.authenticate(user);
    36.     }
    37.  
    38.     private void authenticate (User user){
    39.  
    40.         ServersRequests serversRequests = new ServersRequests(this);
    41.         serversRequests.fetchDataInBackground(user, new GetUserCallback() {
    42.             @Override
    43.             public void done(User returnedUser) {
    44.  
    45.  
    46.                 if(returnedUser == null){
    47.  
    48.                     //show error
    49.                     AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
    50.                     builder.setMessage("Username and Password don't match or don't exist");
    51.                     builder.setPositiveButton("OK", null);
    52.                     builder.show();
    53.                 }
    54.                 else{
    55.  
    56.                     localDatabase.storeData(returnedUser);
    57.                     localDatabase.setUserLoggedIn(true);
    58.  
    59.                     Intent intent = new Intent("ninja.god_father_o7.projectx.UserAreaActivity");
    60.                     startActivity(intent);
    61.                 }
    62.             }
    63.         });
    64.     }
    65.  
    registerActivity

    Code (Text):
    1.  
    2.  EditText etName, etLastName, etEmail, etPassword, etConPassowrd;
    3.  
    4.     @Override
    5.     protected void onCreate (Bundle savedInstanceState){
    6.         super.onCreate(savedInstanceState);
    7.         setContentView(R.layout.activity_register);
    8.  
    9.         etName= (EditText)findViewById(R.id.etName);
    10.         etLastName= (EditText)findViewById(R.id.etLastName);
    11.         etEmail= (EditText)findViewById(R.id.etEmail);
    12.         etPassword= (EditText)findViewById(R.id.etPassword);
    13.         etConPassowrd= (EditText)findViewById(R.id.etCPass);
    14.  
    15.  
    16.     }
    17.  
    18.     public void onRegisterClick (View view){
    19.  
    20.  
    21.         String name = etName.getText().toString();
    22.         String lastName = etLastName.getText().toString();
    23.         String email = etEmail.getText().toString();
    24.         String password = etPassword.getText().toString();
    25.         String conPassword = etConPassowrd.getText().toString();
    26.  
    27.         User user;
    28.  
    29.         if(password.equals(conPassword)) {
    30.  
    31.             user = new User(name, lastName, email, password);
    32.             ServersRequests serversRequests = new ServersRequests(this);
    33.             serversRequests.storeDataInBackground(user, new GetUserCallback() {
    34.                 @Override
    35.                 public void done(User returnedContact) {
    36.                     Intent intent = new Intent("ninja.god_father_o7.projectx.LoginActivity");
    37.                     startActivity(intent);
    38.                 }
    39.             });
    40.  
    41.         }
    42.         else{
    43.  
    44.             Toast.makeText(this, "Passwords don't match!",Toast.LENGTH_LONG).show();
    45.         }
    46.  
    47.         Intent intent = new Intent ("ninja.god_father_o7.projectx.LoginActivity");
    48.         startActivity(intent);
    49.  
    50.  
    register .php

    Code (Text):
    1.  
    2.  
    3. $con = mysqli_connect("","","", "");
    4.    
    5.     $name = $_POST("name");
    6.     $last_name = $_POST("last_name");
    7.     $email = $_POST("email");
    8.     $password = $_POST("password");
    9.  
    10.     $insertquery = mysqli_prepare($con, "INSERT INTO users(name, last_name, email, password) VALUES(?,?,?,?)");
    11.     mysqli_stmt_bind_param($insertquery, "ssss", $name, $last_name, $email, $password);
    12.     mysqli_stmt_execute($insertquery);
    13.    
    14.     mysqli_stmt_close($insertquery);
    15.    
    16.     mysqli_close($con);
    17.  
    fetchUserData.php

    Code (Text):
    1.  
    2. $con = mysqli_connect("","","", "");
    3.  
    4.     $email = $_POST("email");
    5.     $password = $_POST("password");
    6.    
    7.     $selectquery = mysqli_prepare($con, "SELECT * FROM users WHERE email=? AND password=? ");
    8.     mysqli_stmt_bind_param($selectquery, "ss". $email, $password);
    9.     mysqli_stmt_execute($selectquery);
    10.    
    11.     mysqli_stmt_store_result($selectquery):
    12.     mysqli_stmt_bind_result($selectquery, $id, $name, $last_name, $email, $password);
    13.    
    14.     $user = array();
    15.    
    16.     while(mysqli_stmt_fetch(selectquery))
    17.     {
    18.         $user[name]= $name;
    19.         $user[last_name]= $last_name;
    20.         $user[email]= $email;
    21.         $user[password]= $password;
    22.     }
    23.    
    24.     echo json_encode($user);
    25.    
    26.    
    27.     mysqli_stmt_close($selectquery);
    28.    
    29.    
    30.     mysqli_close($con);
    31.  
     
  7. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
    You need to be more specific with your question. What exactly doesn't work?
     
  8. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male
    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 (Text):
    1.  
    2. AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
    3.                     builder.setMessage("Username and Password don't match or don't exist")
    4.  
    and if I pressed the Register here text the app would also crash
     
  9. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
    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.
     
  10. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male
    Code (Text):
    1.  
    2. 04-17 16:13:28.079 9113-9113/ninja.god_father_o7.projectx E/AndroidRuntime: FATAL EXCEPTION: main
    3.                                                                             Process: ninja.god_father_o7.projectx, PID: 9113
    4.                                                                             android.content.ActivityNotFoundException: No Activity found to handle Intent { act=ninja.god_father_o7.LoginActivity }
    5.                                                                                 at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
    6.                                                                                 at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
    7.                                                                                 at android.app.Activity.startActivityForResult(Activity.java:3917)
    8.                                                                                 at android.app.Activity.startActivityForResult(Activity.java:3877)
    9.                                                                                 at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:843)
    10.                                                                                 at android.app.Activity.startActivity(Activity.java:4200)
    11.                                                                                 at android.app.Activity.startActivity(Activity.java:4168)
    12.                                                                                 at ninja.god_father_o7.projectx.RegisterActivity$1.onClick(RegisterActivity.java:25)
    13.                                                                                 at android.view.View.performClick(View.java:5198)
    14.                                                                                 at android.view.View$PerformClick.run(View.java:21147)
    15.                                                                                 at android.os.Handler.handleCallback(Handler.java:739)
    16.                                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
    17.                                                                                 at android.os.Looper.loop(Looper.java:148)
    18.                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
    19.                                                                                 at java.lang.reflect.Method.invoke(Native Method)
    20.                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    21.                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    22. 04-17 16:13:29.800 9113-9113/ninja.god_father_o7.projectx I/Process: Sending signal. PID: 9113 SIG: 9
    23. 04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
    24. 04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:464)
    25. 04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    26. 04-17 16:16:02.609 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
    27. 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)
    28. 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)
    29. 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)
    30. 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)
    31. 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)
    32. 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)
    33. 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)
    34. 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)
    35. 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)
    36. 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)
    37. 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)
    38. 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)
    39. 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)
    40. 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)
    41. 04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.lang.Thread.run(Thread.java:818)
    42. 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)
    43. 04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at libcore.io.Posix.android_getaddrinfo(Native Method)
    44. 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)
    45. 04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
    46. 04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     ... 17 more
    47. 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)
    48. 04-17 16:16:02.610 9639-11895/ninja.god_father_o7.projectx W/System.err:     ... 20 more
    49. 04-17 16:16:02.620 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
    50. 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
    51. 04-17 16:16:02.631 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373140
    52. 04-17 16:16:02.688 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
    53. 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
    54. 04-17 16:16:07.188 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373220
    55. 04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
    56. 04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:464)
    57. 04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    58. 04-17 16:18:12.147 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
    59. 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)
    60. 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)
    61. 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)
    62. 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)
    63. 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)
    64. 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)
    65. 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)
    66. 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)
    67. 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)
    68. 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)
    69. 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)
    70. 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)
    71. 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)
    72. 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)
    73. 04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.lang.Thread.run(Thread.java:818)
    74. 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)
    75. 04-17 16:18:12.149 9639-13810/ninja.god_father_o7.projectx W/System.err:     at libcore.io.Posix.android_getaddrinfo(Native Method)
    76. 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)
    77. 04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
    78. 04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     ... 17 more
    79. 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)
    80. 04-17 16:18:12.150 9639-13810/ninja.god_father_o7.projectx W/System.err:     ... 20 more
    81. 04-17 16:18:12.170 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
    82. 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
    83. 04-17 16:18:12.179 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373140
    84. 04-17 16:18:12.221 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
    85. 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
    86. 04-17 16:18:13.528 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae3731b0
    87. 04-17 16:18:14.287 9639-13845/ninja.god_father_o7.projectx W/System.err: java.lang.SecurityException: Permission denied (missing INTERNET permission?)
    88. 04-17 16:18:14.287 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:464)
    89. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
    90. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.getAllByName(InetAddress.java:215)
    91. 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)
    92. 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)
    93. 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)
    94. 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)
    95. 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)
    96. 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)
    97. 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)
    98. 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)
    99. 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)
    100. 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)
    101. 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)
    102. 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)
    103. 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)
    104. 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)
    105. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.lang.Thread.run(Thread.java:818)
    106. 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)
    107. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at libcore.io.Posix.android_getaddrinfo(Native Method)
    108. 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)
    109. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
    110. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     ... 17 more
    111. 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)
    112. 04-17 16:18:14.288 9639-13845/ninja.god_father_o7.projectx W/System.err:     ... 20 more
    113. 04-17 16:18:14.304 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
    114. 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
    115. 04-17 16:18:14.313 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae3731b0
    116. 04-17 16:18:14.353 9639-9660/ninja.god_father_o7.projectx W/EGL_emulation: eglSurfaceAttrib not implemented
    117. 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
    118. 04-17 16:18:15.274 9639-9660/ninja.god_father_o7.projectx E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae373220
    119. 04-17 16:23:08.070 9639-9639/ninja.god_father_o7.projectx D/AndroidRuntime: Shutting down VM
    120. 04-17 16:23:08.070 9639-9639/ninja.god_father_o7.projectx E/AndroidRuntime: FATAL EXCEPTION: main
    121.                                                                             Process: ninja.god_father_o7.projectx, PID: 9639
    122.                                                                             android.content.ActivityNotFoundException: No Activity found to handle Intent { act=ninja.god_father_o7.LoginActivity }
    123.                                                                                 at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
    124.                                                                                 at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
    125.                                                                                 at android.app.Activity.startActivityForResult(Activity.java:3917)
    126.                                                                                 at android.app.Activity.startActivityForResult(Activity.java:3877)
    127.                                                                                 at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:843)
    128.                                                                                 at android.app.Activity.startActivity(Activity.java:4200)
    129.                                                                                 at android.app.Activity.startActivity(Activity.java:4168)
    130.                                                                                 at ninja.god_father_o7.projectx.RegisterActivity$1.onClick(RegisterActivity.java:25)
    131.                                                                                 at android.view.View.performClick(View.java:5198)
    132.                                                                                 at android.view.View$PerformClick.run(View.java:21147)
    133.                                                                                 at android.os.Handler.handleCallback(Handler.java:739)
    134.                                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
    135.                                                                                 at android.os.Looper.loop(Looper.java:148)
    136.                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5417)
    137.                                                                                 at java.lang.reflect.Method.invoke(Native Method)
    138.                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    139.                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    140.  
    141.  


    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
     
  11. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
  12. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male

    i had it in there but there was a typo, thanks
     
  13. DieselWeasel

    DieselWeasel Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    7
    Joined:
    Apr 16, 2016

    Apr 16, 2016
    7
    0
    5
    Male
    looks like there were some more issues with the PHP files, but i fixed that
     
  14. devmain

    devmain Newbie
    Rank:
    None
    Points:
    16
    Posts:
    16
    Joined:
    Mar 31, 2016

    Hi,
    Sometimes the error about activity not found can also mean that it might not be specified in the manifest xml.

    Cheers!
     

Share This Page

Loading...