Android doesn't support java[x].rmi and you probably wouldn't want to
use this code for issuing requests for many of the same reasons you
wouldn't want to use JDBC. These code bases are built for more
reliable, lower latency, and bandwidth rich networks that most Android
devices are going to operate on most of the time.

A good starting point would be things like the HTTP and URL classes
provided in Android. Take a look at those at
http://code.google.com/android/reference/classes.html

Cheers,
Justin
Android Team @ Google

On Apr 24, 8:37 pm, scimitar <[EMAIL PROTECTED]> wrote:
> Hi Justin,
>
> thanks. I'm now trying to connect to a webservice, and for that I need
> to import java.rmi.RemoteException. But the Android Eclipse plugin is
> not letting me do that. It is giving the error message: 'The import
> java.rmi.RemoteException cannot be resolved'. Is it because Android
> doesn't support this library. What could be the solution for this ?
>
> -umar
>
> On Apr 24, 4:47 pm, "Justin (Google Employee)" <[EMAIL PROTECTED]>
> wrote:
>
> > Try searching this forum for "mysql" 
> > (http://groups.google.com/group/android-developers/search?group=androi...
> > ) or "jdbc" 
> > (http://groups.google.com/group/android-developers/search?group=androi...
> > ) .
>
> > The short answer, however, is that you can't or maybe you can, but
> > it'll be incredibly difficult. Android doesn't have support for
> > arbitrary third-party libraries because they may rely on Java
> > libraries we don't support. Remember, Android does *not* run Java
> > bytecode, despite the fact that code for Android is written in the
> > Java language.
>
> > The slightly longer answer to this question is that you don't want to
> > do this anyway. JDBC was not a communications protocol that was
> > designed to run over unreliable, high latency, low bandwidth data
> > connections like most cellular devices will have. Using JDBC is most
> > likely going to lead to a horrible experience for users. What is a
> > better idea is to expose your data via an HTTP-based interface. HTTP
> > was built to handle the communications environment that Android
> > devices are most likely to live in.
>
> > Cheers,
> > Justin
> > Android Team @ Google
>
> > On Apr 23, 12:37 am, scimitar <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I'm trying to connect to an external mysql database. The code is
> > > something like:
>
> > > try
>
> > > >        {
> > > >            Class.forName(DBCLASS).newInstance();
> > > >        }
> > > >        catch (Exception e)
> > > >        {
> > > >            Log.i("DataLayer", "unable to load jdbc driver");
> > > >        }
> > > >              // Connect to the database
> > > >        // 
> > > > jdbc:mysql://[hostname][,failoverhost...][:port]/[dbname][?param1=value1][&param2=value2].....
>
> > > >        try
> > > >        {
> > > >            connection = DriverManager.getConnection(
> > > >                DBCONNSTRING + DBHOST + "/" + DBNAME + "?user=" + USER + 
> > > > "&password=" + PASSWORD);
>
> > > >        }
> > > >        catch (Exception e)
> > > >        {
>
> > > >        }
>
> > > Basically the 'DriverManager.getConnection()' call fails. The error
> > > messages are:
>
> > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
>
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass 'java.sql.NClob' 0x40069968 threw
> > > > an exception
> > > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass
> > > > 'com.mysql.jdbc.LocalizedErrorMessages_en_US' 0x40069968 threw an
> > > > exception
> > > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass
> > > > 'com.mysql.jdbc.LocalizedErrorMessages_en' 0x40069968 threw an exception
> > > > I/dalvikvm-heap(  596): GC! (75 sec since last GC)
> > > > I/dalvikvm-heap(  596): GC old usage 90.6%; now 0.985MB used / 1.971MB
> > > > soft max (2.062MB real max)
> > > > I/dalvikvm-heap(  596): GC freed 1736 objects / 106824 bytes in 56ms
> > > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass
> > > > 'com.mysql.jdbc.LocalizedErrorMessages' 0x40069968 threw an exception
> > > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass
> > > > 'com.mysql.jdbc.LocalizedErrorMessages_en_US' 0x40018950 threw an
> > > > exception
> > > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass
> > > > 'com.mysql.jdbc.LocalizedErrorMessages_en' 0x40018950 threw an exception
> > > > D/dalvikvm(  596): Exception Ljava/lang/ClassNotFoundException; from
> > > > PathClassLoader.java:205 not caught locally
> > > > D/dalvikvm(  596): NOTE: loadClass
> > > > 'com.mysql.jdbc.LocalizedErrorMessages' 0x40018950 threw an exception
> > > > D/dalvikvm(  596): Exception Ljava/lang/RuntimeException; from
> > > > Messages.java:68 not caught locally
> > > > W/dalvikvm(  596): Exception Ljava/lang/RuntimeException; thrown
> > > > during Lcom/mysql/jdbc/Messages;.<clinit>
> > > > D/dalvikvm(  596): Exception Ljava/lang/ExceptionInInitializerError;
> > > > from Util.java:350 not caught locally
> > > > W/dalvikvm(  596): Exception Ljava/lang/ExceptionInInitializerError;
> > > > thrown during Lcom/mysql/jdbc/Util;.<clinit>
> > > > D/dalvikvm(  596): Exception Ljava/lang/ExceptionInInitializerError;
> > > > from ViewRoot.java:964 not caught locally
> > > > D/dalvikvm(  596): Exception Ljava/lang/ExceptionInInitializerError;
> > > > from ZygoteInit.java:1555 not caught locally
>
> > > I would really appreciate if somebody could help me.
>
> > > thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to