Hi everyone. I am very new to Android development and to
using Sybase.

When my program calls synchronize() it hangs and does
nothing there after.

My program is using a BAPI to create a sales order in SAP. I
created a MBO and then created an operation inside called
SOCreate which is supposed to create the Sales Order in SAP.
The first part of the code is setting all the values for the
BAPI (CreateFromDat1). I can see that all the values are
being added to the BAPI but when I want to sync the program
hangs.

All the code is in 1 Activity. Below is the code I am using
to try connect to the server and to create the Sales Order.
I have also attached the last bit of the LogCat file after
the connection code.

Any help will be greatly appreciated as I cant find anything
on the internet that can help me.

Thank you!!!

-----------------------------------------------------------------

new Thread() {

public void run()
{

try
{

int count = 0;
while (!initializationDone)
{
dialog.setProgress(++count);
Thread.sleep(100);

if (count == 100)
{
count = 0;
}
}
dialog.cancel();

A_SODB.synchronize();

A_SO_2Activity.this.finish();
}
catch (Exception e)
{
dialog.cancel();
}
}
}.start();

Application app = Application.getInstance();

app.setApplicationContext(this);
app.setApplicationIdentifier("A_SO");

new Thread(new Runnable()
{
@Override
public void run()
{
try
{
Application app = Application.getInstance();
A_SODB.setApplication(app);

A_SODB.getSynchronizationProfile().setServerName(HOST);

ConnectionProperties connProps =
app.getConnectionProperties();
LoginCredentials loginCredentials = new
LoginCredentials(USERNAME, PASSWORD);

connProps.setLoginCredentials(loginCredentials);
connProps.setServerName(HOST);
connProps.setPortNumber(PORT);

app.registerApplication();

if (app.getRegistrationStatus() !=
RegistrationStatus.REGISTERED)
{
app.registerApplication(TIMEOUT);
}

try {
A_SODB.disableChangeLog();

SynchronizationGroup sg =
A_SODB.getSynchronizationGroup("default");
sg.setEnableSIS(true);
sg.save();

SalesOrderMBOSOCreateOperation so = new
SalesOrderMBOSOCreateOperation();
so.submitPending();

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

A_SODB.enableChangeLog();

}catch (Exception err) {
e.printStackTrace();

}finally {
e.printStackTrace();
}
}
}).start();
04-20 11:55:36.339: I/dalvikvm(1086): Wrote stack traces to
'/data/anr/traces.txt'

04-20 11:55:36.470: D/dalvikvm(1086): GC_CONCURRENT freed
166K, 3% free 9304K/9543K, paused 39ms+22ms

04-20 11:55:36.519: I/dalvikvm(1086): threadid=3: reacting
to signal 3

04-20 11:55:36.658: I/dalvikvm(1086): Wrote stack traces to
'/data/anr/traces.txt'

04-20 11:55:37.038: I/dalvikvm(1086): threadid=3: reacting
to signal 3

04-20 11:55:37.178: I/dalvikvm(1086): Wrote stack traces to
'/data/anr/traces.txt'

04-20 11:55:37.529: I/dalvikvm(1086): threadid=3: reacting
to signal 3

04-20 11:55:37.660: I/dalvikvm(1086): Wrote stack traces to
'/data/anr/traces.txt'

04-20 11:55:38.050: I/dalvikvm(1086): threadid=3: reacting
to signal 3

04-20 11:55:38.199: I/dalvikvm(1086): Wrote stack traces to
'/data/anr/traces.txt'

04-20 11:55:39.718: I/MocaLog(1086): 20T115539, T1, ThreadID
= Thread[main,5,main] maps to short thread id 1 04-20
11:55:39.739: W/System.err(1086): fsync failed: EBADF (Bad
file number)

04-20 11:55:39.768: I/MocaLog(1086): 20T115539, T1, Starting
Log. Current time: 20120420T115539

04-20 11:55:39.778: W/System.err(1086): fsync failed: EBADF
(Bad file number)

04-20 11:55:39.868: I/MocaLog(1086): 20T115539, T1, MocaLog
Logging Level: Normal

04-20 11:55:39.878: W/System.err(1086): fsync failed: EBADF
(Bad file number)

04-20 11:55:39.948: I/MocaLog(1086): 20T115539, T1, MocaLog
AppId: null

04-20 11:55:39.948: W/System.err(1086): fsync failed: EBADF
(Bad file number)

04-20 11:55:40.038: I/MocaLog(1086): 20T115539, T1, iMo
Version Number: 2.1.2.6188

04-20 11:55:40.038: W/System.err(1086): fsync failed: EBADF
(Bad file number)

04-20 11:55:40.159: I/MocaLog(1086): 20T115540, T1,
MessagingClientLib: initInstance. App ID: A_SO, Log Level 1
04-20 11:55:40.179: W/System.err(1086): fsync failed: EBADF
(Bad file number)

04-20 11:55:40.499: I/System.out(1086): CONSOLE TRACE:
setListener

04-20 11:55:40.508: I/System.out(1086): CONSOLE TRACE:
addConnection for Connection key: a_so:1.0

04-20 11:55:40.519: I/System.out(1086): CONSOLE TRACE: leave
setListener

04-20 11:55:40.718: D/UpgradeUtil(1086): upgrade takes : 1ms

04-20 11:55:41.248: I/MocaLog(1086): 20T115541, T2, ThreadID
= Thread[Thread-109,5,main] maps to short thread id 2 04-20
11:55:41.308: W/System.err(1086): fsync failed: EBADF (Bad
file number)

04-20 11:55:41.308: D/dalvikvm(1086): GC_CONCURRENT freed
306K, 5% free 9435K/9863K, paused 8ms+30ms

04-20 11:55:41.390: I/MocaLog(1086): 20T115540, T2,
FileTransfer: addTraceFileForUpload:
/data/data/com.sup.objectapi/files/a_so_1_0_log.txt 04-20
11:55:41.399: W/System.err(1086): fsync failed: EBADF (Bad
file number)

04-20 11:55:41.529: I/MocaLog(1086): 20T115541, T2,
FileTransfer: addTraceFileForUpload:
/data/data/com.sup.objectapi/files/a_so_1_0_log.txt.bak
04-20 11:55:41.549: W/System.err(1086): fsync failed: EBADF
(Bad file number)

04-20 11:55:41.699: D/dalvikvm(1086): Trying to load lib
/data/data/com.sup.objectapi/lib/libultralitej12.so
0x412a6c08 04-20 11:55:41.722: D/dalvikvm(1086): Added
shared lib
/data/data/com.sup.objectapi/lib/libultralitej12.so
0x412a6c08 04-20 11:55:41.739: D/dalvikvm(1086): No
JNI_OnLoad found in
/data/data/com.sup.objectapi/lib/libultralitej12.so
0x412a6c08, skipping init 04-20 11:55:43.939:
D/gralloc_goldfish(1086): Emulator without GPU emulation
detected.