Skip to Content
author's profile photo Former Member
Former Member

Registering Android emulator to SCC without relayserver?

Hi

I am trying to register Android Simulator to Sybase control center in manual mode using below code ,but I could not register devices , it keeps checking for relay server URL and throws an error unable to find good Relay server URL.

Is it mandatory to have relayserver setup to register even emulator to SCC, then how to bypass the error and register the device.

try {

/* STEP1:Initialize the App */

LiteUserManager.initInstance(getApplicationContext(), "FirstAPP");

/* STEP2:Provide SUP connection Settings and Register the User */

LiteUserManager usrMngr = LiteUserManager.getInstance();

// usrMngr.setConnectionProfile(Server_Host, Port, FormID/companyID);

if (!usrMngr.isRegistered()) {

usrMngr.setConnectionProfile(server, 80, "Company1");

// usrMngr.registerUser(userName, actCode);

usrMngr.registerUser("APPUSER", "123");

}

} catch (MessagingClientExceptione) {

e.printStackTrace();

}

Thanks

Santosh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 27, 2012 at 10:18 AM

    Hi,

    Follow ths steps:

    Application app = Application.getInstance();

    if(!"SUPProject".equals(app.getApplicationIdentifier())){

    app.setApplicationIdentifier("SUPProject");

    app.setApplicationContext(Activity.this);

    }

    Application app = Application.getInstance();

    ConnectionProperties connProps = app.getConnectionProperties();

    LoginCredentials loginCredentials = new LoginCredentials(USERNAME, PASSWORD);

    connProps.setLoginCredentials(loginCredentials);

    connProps.setServerName(HOST);

    connProps.setPortNumber(PORT);

    SUPProjectDB.setApplication(app);

    SUPProjectDB.getSynchronizationProfile().setServerName(HOST); // Convenience only

    if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED)

    {

    app.registerApplication(TIMEOUT);

    }

    else

    {

    app.startConnection(TIMEOUT);

    }

    ths will work.

    bye

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 01, 2012 at 09:39 AM

    Hi Santhosh,

    You can directly register the android app on simulator with SCC by passing SUPserverIP, Port and company ID as 0. modified code snipet is as below.

    try {

    /* STEP1:Initialize the App */

    LiteUserManager.initInstance(getApplicationContext(), "FirstAPP");

    /* STEP2:Provide SUP connection Settings and Register the User */

    LiteUserManager usrMngr = LiteUserManager.getInstance();

    // usrMngr.setConnectionProfile(SUPServer_Host, Port, FormID/companyID);

    if (!usrMngr.isRegistered()) {

    usrMngr.setConnectionProfile(SUPserverIP, 5001, "0");

    // usrMngr.registerUser(userName, actCode);

    usrMngr.registerUser("APPUSER", "123");

    }

    } catch (MessagingClientExceptione) {

    e.printStackTrace();

    }

    In case of error please check for the following.

    1. AndroidManifest.xml file of your project should have the below permissions.

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

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

    2. Check if the messaging port of your SUP is other than 5001. You can find it at SCC>>Localhost@localhost>>Server>>ServerConfiguration>>Messaging.

    If you are still getting any error, please revert back with error details.

    Regards

    Rohith

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.