appErrorCode 0 when quering User Service in android

0 votes

Hello, I have a problem in quering User Service in Android.

Almost app user have no problem, but some tablet user have a problem.

A problem is 'appErrorCode 0' when quering User Service ( when user want to join member)

Full source is below.

-asynctask excute

mAuthTask = new UserJoinTask();
mAuthTask.execute((Void) null);

 

-in asynctask doInBackground..

userService.getUser(Id, new App42CallBack() {
    @Override
    public void onSuccess(Object o) {
        getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {     //if Id is already exists
                Toast.makeText(getActivity(), "Id already exists. try another Id.", Toast.LENGTH_LONG).show();
                idEdittext.requestFocus();
                idEdittext.setText("");
            }
        });
    }

    @Override
    public void onException(Exception ex) {                            //if id is not exists, so user can use Id to join
        App42Exception Exception = (App42Exception)ex;
        final int appErrorCode = Exception.getAppErrorCode();

        if(appErrorCode == 2006 || appErrorCode == 2000){
            makeUser_UserProfile_JSONbyID(userService);      
        }else{
            getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(getActivity(), "AppErrorCode: "+appErrorCode+" Error!", Toast.LENGTH_LONG).show();     //appErrorCode 0 occurs!!
                }
            });
        }
    }
});

 

the problem is appErrorCode 0 is occured in userService.getUser!

plz help me. thanks

asked Jun 20, 2016 in Android by HunHee Na (21 points)
recategorized Jun 20, 2016 by HunHee Na

1 Answer

0 votes
Hi,

Could you please print the internal logs of this method and share with us? It will help us to provide better support to you.

To print the internal logs, put the below line of code just after the key initialization:

App42Log.setDebug(true);

Regards,

Himanshu Sharma
answered Jun 20, 2016 by hs00105 (2,005 points)
# Crashlytics - plaintext stacktrace downloaded by nahunhee at Mon, 27 Jun 2016 00:36:18 GMT
# URL: https://fabric.io/smartemath/android/apps/nahunhee.circle/issues/576bd47affcdc04250b55a52/sessions/5770718d00d3000134bef0721a904a7e
# Organization: SmartEMath
# Platform: android
# Application: 척척박사! 원의 넓이
# Version: 1.384 (29)
# Bundle Identifier: nahunhee.circle
# Issue: 51
# Session: 5770718d00d3000134bef0721a904a7e
# Date: 2016-06-27T00:28:13Z

Non-fatal Exception: com.shephertz.app42.paas.sdk.android.App42Exception: java.net.UnknownHostException: Unable to resolve host "api.shephertz.com": No address associated with hostname
       at com.shephertz.app42.paas.sdk.android.user.UserService.authenticate(UserService.java:1566)
       at com.shephertz.app42.paas.sdk.android.user.UserService$20.run(UserService.java:1593)
Caused by java.net.UnknownHostException: Unable to resolve host "api.shephertz.com": No address associated with hostname
       at java.net.InetAddress.lookupHostByName(InetAddress.java:435)
       at java.net.InetAddress.getAllByNameImpl(InetAddress.java:255)
       at java.net.InetAddress.getAllByName(InetAddress.java:218)
       at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
       at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
       at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
       at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:368)
       at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
       at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
       at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
       at com.shephertz.app42.paas.sdk.android.connection.RESTConnectorCache.getPostResponse(RESTConnectorCache.java:529)
       at com.shephertz.app42.paas.sdk.android.connection.RESTConnectorCache.executePost(RESTConnectorCache.java:246)
       at com.shephertz.app42.paas.sdk.android.user.UserService.authenticate(UserService.java:1558)
       at com.shephertz.app42.paas.sdk.android.user.UserService$20.run(UserService.java:1593)

Crashed: Thread-1326: 0 0 0x0000000000000000
       at com.shephertz.app42.paas.sdk.android.user.UserService.authenticate(UserService.java:1566)
       at com.shephertz.app42.paas.sdk.android.user.UserService$20.run(UserService.java:1593)
App42 works on smartphone fine, but tablet make above error!
plz help me.
Hi Hun, If I see the logs I will find there is a exception Unable to resolve host "api.shephertz.com": No address associated with hostname means there is a connectivity issues.
If you are using sync API, please do catch the exception ur self to prevent app crash in either cases.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...