on 04-26-2012 1:20 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.