|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
svnkit on the Android operating systems - some ideas and hintsHi there,
I just wanted to let you know about possibilities to run SVNkit on the Android Operating System. For those of you who haven't heard of it, Android is an OS developed by Google and other Contributors, targeted for mobile phones and entertainment devices. It's based on a linux kernel and comes with a very special kind of Java: A register based Dalvik VM (opposed to the stack based JVM which is NOT available on Android) that runs dex code. Software for Android is written in Java, compiled with javac and then converted to dex code. There is currently no SVN client for Android. Maybe most people just don't need it on their phones - I did need it, so I started writing one yesterday. I was happy to find SVNkit. Most pure Java JAR libraries can be used on Android without any manual adjustments, but for SVNkit those three were needed: * java.rmi.server.UID is not present on Android. As far as I could see it's only used in SVNUUIDGenerator to create random numbers, so I changed it to use Math.random() instead. I guess this makes the UIDs less Unique and is not the right way to do it, but it works for me. * The MessageFormat class on Android yields a strange Exception in SVNUUIDGenerator.formatUUID(). I'm using String.format("%s%s%s%s-%s%s-%s%s-%s%s-%s%s%s%s%s%s", hexNumbers) instead. * javax.security.sasl.* is not present on Android. SVNConnection.createSASLAuthenticator() uses Reflection to load SVNSaslAuthenticator and catches any Throwables that may arise. Normally, a missing javax.security.sasl.* would generate some kind of Exception that can be cought, even on Android this is the default behaviour. For some strange reason, in this case it crashes the whole Dalvik VM, so there is nothing to catch. I commented out the whole try-catch-clause so that SVNPlainAuthenticator is always returned. At least two of my three "fixes" are just dirty hacks, that's why I don't even think about polluting your repository with those. But with those hacks, I finally managed to get an SVN client with a simple GUI up and running on my mobile phone which I'm using many times a day now. I hope my approach to make SVNkit portable to Android inspires you. I don't have much time to be a code contributor myself (shame on me) and I don't want to mess up your beautiful code, but I think I just indicated that only minor changes would be needed to open yet another platform for SVNkit. On the other hand, I'm just using cleanup, update and commit in the High Level API, so maybe a lot of other problems might pop up if more functionality is used, who knows... By the way, there is now a "Native Developement Kit" that would allow to compile the standard SVN C(++) impementation to native Code for Android phones. But the limitations of that "NDK" are even bigger than those of the Java implementation, and it can't generate completely native apps, a Java frontend is needed anyway. Because of that, I think SVNkit is the way to go if someone wants SVN on Android. with best regards, Brian Schimmel PS: If anyone wonders why I need SVN on my mobile phone: It has a nice QWERTY-Keyboard, perfectly fitted to write parts of my Bachelor Thesis on the device while on the go. But sometimes I need to work on a PC, too, and I'm using SVN to keep my latex source files syncrhonized between several PCs and the cell phone. |
|
|
Re: svnkit on the Android operating systems - some ideas and hintsHello Brian,
Thanks for sharing your experience using SVNKit on Android with us, it was very interesting to know SVNKit could be used on this platform while the original svn can not be. You can send us your patch, so that if we ever decide to support this platform by ourselves, we could make use your information and experience. Thank you. ---- Alexander Sinyushkin, TMate Software, http://svnkit.com/ - Java [Sub]Versioning Library! Brian Schimmel wrote: > Hi there, > > I just wanted to let you know about possibilities to run SVNkit on the > Android Operating System. > > For those of you who haven't heard of it, Android is an OS developed > by Google and other Contributors, targeted for mobile phones and > entertainment devices. It's based on a linux kernel and comes with a > very special kind of Java: A register based Dalvik VM (opposed to the > stack based JVM which is NOT available on Android) that runs dex code. > Software for Android is written in Java, compiled with javac and then > converted to dex code. > > There is currently no SVN client for Android. Maybe most people just > don't need it on their phones - I did need it, so I started writing > one yesterday. I was happy to find SVNkit. Most pure Java JAR > libraries can be used on Android without any manual adjustments, but > for SVNkit those three were needed: > > * java.rmi.server.UID is not present on Android. As far as I could > see it's only used in SVNUUIDGenerator to create random numbers, so I > changed it to use Math.random() instead. I guess this makes the UIDs > less Unique and is not the right way to do it, but it works for me. > * The MessageFormat class on Android yields a strange Exception in > SVNUUIDGenerator.formatUUID(). I'm using > String.format("%s%s%s%s-%s%s-%s%s-%s%s-%s%s%s%s%s%s", hexNumbers) instead. > * javax.security.sasl.* is not present on Android. > SVNConnection.createSASLAuthenticator() uses Reflection to load > SVNSaslAuthenticator and catches any Throwables that may arise. > Normally, a missing javax.security.sasl.* would generate some kind of > Exception that can be cought, even on Android this is the default > behaviour. For some strange reason, in this case it crashes the whole > Dalvik VM, so there is nothing to catch. I commented out the whole > try-catch-clause so that SVNPlainAuthenticator is always returned. > > At least two of my three "fixes" are just dirty hacks, that's why I > don't even think about polluting your repository with those. But with > those hacks, I finally managed to get an SVN client with a simple GUI > up and running on my mobile phone which I'm using many times a day now. > > I hope my approach to make SVNkit portable to Android inspires you. I > don't have much time to be a code contributor myself (shame on me) and > I don't want to mess up your beautiful code, but I think I just > indicated that only minor changes would be needed to open yet another > platform for SVNkit. On the other hand, I'm just using cleanup, update > and commit in the High Level API, so maybe a lot of other problems > might pop up if more functionality is used, who knows... > > By the way, there is now a "Native Developement Kit" that would allow > to compile the standard SVN C(++) impementation to native Code for > Android phones. But the limitations of that "NDK" are even bigger than > those of the Java implementation, and it can't generate completely > native apps, a Java frontend is needed anyway. Because of that, I > think SVNkit is the way to go if someone wants SVN on Android. > > with best regards, > Brian Schimmel > > PS: If anyone wonders why I need SVN on my mobile phone: It has a nice > QWERTY-Keyboard, perfectly fitted to write parts of my Bachelor Thesis > on the device while on the go. But sometimes I need to work on a PC, > too, and I'm using SVN to keep my latex source files syncrhonized > between several PCs and the cell phone. --------------------------------------------------------------------- To unsubscribe, e-mail: svnkit-users-unsubscribe@... For additional commands, e-mail: svnkit-users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |