Is it necessary to disable C++ exception handling when interfacing with android?

by Elvis Dowson » Wed, 24 Jun 2009 21:04:01 GMT


Sponsored Links
 Hi,
      is there any reason for disabling exception handling in library
code, such as ustl-1.0?

For example, ustl/uexception.cpp line 60

/// Writes the exception as text into stream \p os.
void exception::text_write (ostringstream& os) const
{
#if !PLATFORM_ANDROID
    try {
#endif
        string buf;
        info (buf);
        os << buf;
#if !PLATFORM_ANDROID
    } catch (...) {}
#endif
}


Best regards,

Elvis

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Odp: A simplest Application access "Content Provider"

Why are you posting this on Android-kernel not on android-platform?

W dniu 2010-05-05 13:57 uytkownik <linlo...@gmail.com> napisa:

hi,

Usually, we can inherit class "Activity" to access "Content Provider", such
as SMS/Contacts with following codes:
===========================
public class ActivityTest extends Activity {
...
    private void insertSms(String str_address, String content){
        ContentResolver contentResolver = getContentResolver();
        String strUriInbox = "content://sms/inbox";
        ContentValues values = new ContentValues();
        values.put("address", str_address);
        values.put("date", Calendar.getInstance().getTime().getTime());
        values.put("protocol", "0");
        values.put("status", "-1");
        values.put("type", "1");
        values.put("body", content);
        Uri uriSms = Uri.parse(strUriInbox);
        contentResolver.insert(uriSms, values);
    }
}
===========================

However, I don't want to show a activity if write SMS database. So, I design
a simplest application without Activity with following codes:
===========================
package com.xxx.NoActivityTest;

public class NoActivityTest {
    public NoActivityTest(){
    }

    private void insertSms(String str_address, String content){
        ContentResolver contentResolver = *getContentResolver*();
*//"NoActivityTest"
don't inherit from "Activity", so, don't recongnize "getContentResolver()",
so, can't get "ContentResolver" instance.*
        String strUriInbox = "content://sms/inbox";
        ContentValues values = new ContentValues();
        values.put("address", str_address);
        values.put("date", Calendar.getInstance().getTime().getTime());
        values.put("protocol", "0");
        values.put("status", "-1");
        values.put("type", "1");
        values.put("body", content);
        Uri uriSms = Uri.parse(strUriInbox);
        contentResolver.insert(uriSms, values);
    }

    public static void main(String[] args) {
        NoActivityTest ex = new NoActivityTest();
        ex.insertSms("13912345678", "test0001");
    }
}
===========================

As you seen from comments, can't get "ContentResolver" instance because
don't recongnize "getContentResolver()".
How to overcome this issue?

Thanks.



-- 
unsubscribe: 
android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
website: 

2. Title bar display

Hi,

Is it possible to disable title bar display dynamically after setting
the content view by setting the NoTitlebar theme?

All the posts I have read told that any title bar changes we can make
only before setContentView() call..

Thanks in advance,
Revathi

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

3. troubles reading other apps config files

4. When I override Adapter.isEnabled() the ListView divider isn't displayed

5. webview touch problem

6. FroYo and PDF

7. BluetoothServerSocket: how to close correctly?