Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,733,899 Members 49,535 Now Online
XDA Developers Android and Mobile Development Forum

[Dev][RELEASE][Lib/Java] JDroidLib Java ←|→ Android Communications Library

Tip us?
 
Beatsleigher
Old
(Last edited by Beatsleigher; 30th May 2014 at 07:21 PM.)
#1  
Beatsleigher's Avatar
Senior Member - OP
Thanks Meter 519
Posts: 1,051
Join Date: Oct 2011
Location: Somewhat around here : 52.366848,8.3345

 
DONATE TO ME
Prompt [Dev][RELEASE][Lib/Java] JDroidLib Java ←|→ Android Communications Library

Hey there,

many of you are probably familiar with @regaw_leinad's AndroidLib.
It is a really nicely coded, and easy-to-use .Net class library, which allows real easy communication with Android devices.
Quote:
Originally Posted by regaw_leinad
AndroidLib is a .NET assembly written in C# (C-Sharp) that easily handles communication between a connected Android device and your program.
However, it has a downside. That downside being; it only works with .Net languages. .net languages include:
Code:
# Visual Basic
# C#
# F#
# Visual C++
# ASP.Net
As you might have guessed, Java does not belong to the .Net language set.
And as I moved from .Net to Java (allows my projects and libs to become available to a wider audience), I don't have the privilege to use AndroidLib, which is a real bummer.
This is why I have started JDroidLib.

EDIT: 01.03.2014
JDroidLib has undergone some major updates, with loads of kinks fixed, and features revamped.
See the lists below for more info. (Everything has changed, there).

Oh, and the code has a kind of easter egg

Current features:
Code:
 # Execute any type of ADB command from a single method. 
    (This method always returns output, but you can execute the method, without grabbing it).
 # Execute any fastboot command frmo a single method. (Same returns as above.)
 # Install ADB/fastboot to either fixed, or custom location. (On MAC OS/Linux: Binaries are automatically chmod-ed!)
 # Pull entire build.prop from device to hard drive
 # Get single build properties (!!!)
 # Push build.prop back to device.
 # Reboot device (5-way/ADB + fastboot)
 # Get list of devices. (Returned as generic List<String>)
 # Get device information (Battery, SU, BusyBox, CPU - MORE COMING!)
 # Get device state
 # Start ADB server
 # Stop ADB server
 # Restart ADB server.
 # Much, much more. See JavaDocs for more!
Current bugs:
Quote:
There's a weird bug in the Battery department, where the loaded battery level is 0. Looking into it! Fixed.
Slight bug in reboot methods, device isn't rebooting. Fixed.
Planned features:
Code:
 # Get phone/WiFi/BlueTooth/etc. information
 # And anything else that comes to mind!
License:
Code:
/*
 * Copyright (C) 2013 Simon/Beatsleigher.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 */
Source code:
To get a copy of the source code, visit my GitHub
There will be no pre-compiled JARs. To get a JAR, you have to download and compile the source.
The IDE used is NetBeans 8.0 with JDK 7
To download NetBeans, visit http://netbeans.org

JDroidLib Documentation:
http://team-m4gkbeatz.eu

How to Use JDroidLib:
http://www.youtube.com/watch?v=dRSwailf7GI

Thanks:
Thanks to @regaw_leinad for having the original idea!
Thanks to you, XDA, for taking the time and looking at my programs/libs. Much appreciated!
XDA Portal Story 04.12.2013
Newer XDA Portal Story 03.03.2014

Have fun with JDroidLib and don't forget to contribute your own code!


My popular projects on GitHub
Universal Android Toolkit is now in BETA, JDroidLib is released!


My work (other) work:
"Nothing is infinite, except human stupidity." - Albert Einstein.
"You shouldn't trust everything you see on the internet." - Abraham Lincoln.

If you haven't already, add me to your circles on Google Plus
The Following 14 Users Say Thank You to Beatsleigher For This Useful Post: [ Click to Expand ]
zylor Old
#2  
Guest
Thanks Meter
Posts: n/a
This project made it to the Home Page!

http://www.xda-developers.com/androi...droidlib-java/

Congrats mate

Subscribed!
 
Beatsleigher
Old
#3  
Beatsleigher's Avatar
Senior Member - OP
Thanks Meter 519
Posts: 1,051
Join Date: Oct 2011
Location: Somewhat around here : 52.366848,8.3345

 
DONATE TO ME
Quote:
Originally Posted by zylor View Post
This project made it to the Home Page!

http://www.xda-developers.com/androi...droidlib-java/

Congrats mate

Subscribed!
(^-^) Awesome
But where did that other thread come from? o.O


My popular projects on GitHub
Universal Android Toolkit is now in BETA, JDroidLib is released!


My work (other) work:
"Nothing is infinite, except human stupidity." - Albert Einstein.
"You shouldn't trust everything you see on the internet." - Abraham Lincoln.

If you haven't already, add me to your circles on Google Plus
 
AdamOutler
Old
#4  
AdamOutler's Avatar
Recognized Developer
Thanks Meter 9548
Posts: 5,174
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
You know, you could always contribute to CASUAL. We use Java and NetBeans as well and we are already a few years ahead of you. We could pull out the ADB/fastboot/busybox/Heimdall portions of CASUAL to distribute separately, by making some small changes to our make file and would have what you're going for here.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
Wanna see the longest Linux BASH script ever made? click here.
The Following User Says Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
Beatsleigher
Old
#5  
Beatsleigher's Avatar
Senior Member - OP
Thanks Meter 519
Posts: 1,051
Join Date: Oct 2011
Location: Somewhat around here : 52.366848,8.3345

 
DONATE TO ME
Quote:
Originally Posted by AdamOutler View Post
You know, you could always contribute to CASUAL. We use Java and NetBeans as well and we are already a few years ahead of you. We could pull out the ADB/fastboot/busybox/Heimdall portions of CASUAL to distribute separately, by making some small changes to our make file and would have what you're going for here.
Wow. Never would have thought you'd reply to or even look at one of my threads!
It's a good idea. I'll have a think about it. I'm going to keep working on this, mainly because someone (or even I) could eventually port it to C/C++ if they need to.


My popular projects on GitHub
Universal Android Toolkit is now in BETA, JDroidLib is released!


My work (other) work:
"Nothing is infinite, except human stupidity." - Albert Einstein.
"You shouldn't trust everything you see on the internet." - Abraham Lincoln.

If you haven't already, add me to your circles on Google Plus
The Following 2 Users Say Thank You to Beatsleigher For This Useful Post: [ Click to Expand ]
 
cybojenix
Old
#6  
cybojenix's Avatar
Recognized Developer
Thanks Meter 1364
Posts: 771
Join Date: Apr 2012

 
DONATE TO ME
Quote:
Originally Posted by Beatsleigher View Post
Wow. Never would have thought you'd reply to or even look at one of my threads!
It's a good idea. I'll have a think about it. I'm going to keep working on this, mainly because someone (or even I) could eventually port it to C/C++ if they need to.
hey I've just done a draft for a python adb (PyAdb) which removes entirely the dependence of the adb binary. when you get into it, it's actually quite simple to replicate it. I've added reference links in my thread as well, and the python is so simple you can see how it all works

http://forum.xda-developers.com/show....php?t=2574326

ping me if you want any help with anything. I'm getting on with my java studies so I may be able to help with porting it over
Quote:
<cybojenix> Every single language makes sense. They're logical
<cybojenix> Then there's just Perl.
<helicopter88> perl just looks like an esotheric language
<cybojenix> Perl is what came out from those monkeys trying to recreate Shakespeare
<helicopter88> cybojenix, this is the wise sentence of the month

like my work? buy me a present
 

Proud member of TeamHackLG


contact me here
My Builds
P350 kernels: 2.6.35 | 3.0.x
Github
devices: p350 | e610 | Nexus 7 | tegra note 7

 
Beatsleigher
Old
#7  
Beatsleigher's Avatar
Senior Member - OP
Thanks Meter 519
Posts: 1,051
Join Date: Oct 2011
Location: Somewhat around here : 52.366848,8.3345

 
DONATE TO ME
Quote:
Originally Posted by cybojenix View Post
hey I've just done a draft for a python adb (PyAdb) which removes entirely the dependence of the adb binary. when you get into it, it's actually quite simple to replicate it. I've added reference links in my thread as well, and the python is so simple you can see how it all works

http://forum.xda-developers.com/show....php?t=2574326

ping me if you want any help with anything. I'm getting on with my java studies so I may be able to help with porting it over
The main reason I coded this is for use in my own programs, coded in Java.
I guess the Python wrappers coded by you and the other member, are for use with the Python interpreter.
But I guess I could help port stuff over and you could help with JDroidLib.

Sent from my GT-I9505 using XDA Premium 4 mobile app


My popular projects on GitHub
Universal Android Toolkit is now in BETA, JDroidLib is released!


My work (other) work:
"Nothing is infinite, except human stupidity." - Albert Einstein.
"You shouldn't trust everything you see on the internet." - Abraham Lincoln.

If you haven't already, add me to your circles on Google Plus
 
cybojenix
Old
#8  
cybojenix's Avatar
Recognized Developer
Thanks Meter 1364
Posts: 771
Join Date: Apr 2012

 
DONATE TO ME
Quote:
Originally Posted by Beatsleigher View Post
The main reason I coded this is for use in my own programs, coded in Java.
I guess the Python wrappers coded by you and the other member, are for use with the Python interpreter.
But I guess I could help port stuff over and you could help with JDroidLib.

Sent from my GT-I9505 using XDA Premium 4 mobile app
Sorry you got the wrong end of the stick. The one by me is an adb client in python, not a wrapper. I was suggesting look at the methods it uses so the same can be done for JDroidLib, without needing a dependence on the adb binary. It's just commands passed via TCP

Sent from my Nexus 7 using Tapatalk
Quote:
<cybojenix> Every single language makes sense. They're logical
<cybojenix> Then there's just Perl.
<helicopter88> perl just looks like an esotheric language
<cybojenix> Perl is what came out from those monkeys trying to recreate Shakespeare
<helicopter88> cybojenix, this is the wise sentence of the month

like my work? buy me a present
 

Proud member of TeamHackLG


contact me here
My Builds
P350 kernels: 2.6.35 | 3.0.x
Github
devices: p350 | e610 | Nexus 7 | tegra note 7

 
Beatsleigher
Old
#9  
Beatsleigher's Avatar
Senior Member - OP
Thanks Meter 519
Posts: 1,051
Join Date: Oct 2011
Location: Somewhat around here : 52.366848,8.3345

 
DONATE TO ME
Quote:
Originally Posted by cybojenix View Post
Sorry you got the wrong end of the stick. The one by me is an adb client in python, not a wrapper. I was suggesting look at the methods it uses so the same can be done for JDroidLib, without needing a dependence on the adb binary. It's just commands passed via TCP

Sent from my Nexus 7 using Tapatalk
Ahhh. I gotcha. Sure. If you want, check out the source and see what you can do. I'll take a look at it as soon as I've finished my Tekkit server and got DetectCPUv3 done.

Sent from my GT-I9505 using XDA Premium 4 mobile app


My popular projects on GitHub
Universal Android Toolkit is now in BETA, JDroidLib is released!


My work (other) work:
"Nothing is infinite, except human stupidity." - Albert Einstein.
"You shouldn't trust everything you see on the internet." - Abraham Lincoln.

If you haven't already, add me to your circles on Google Plus
 
Beatsleigher
Old
#10  
Beatsleigher's Avatar
Senior Member - OP
Thanks Meter 519
Posts: 1,051
Join Date: Oct 2011
Location: Somewhat around here : 52.366848,8.3345

 
DONATE TO ME
Default JDroidLib is back, and beter than ever!

Hey guys,

I was asked by a few friends and other people, if I had abbandoned JDroidLib, because I wasn't updating it for so long, so I haven't abbandoned it, nor have I abbandoned any other projects of mine, which are currently being ported to Java, it's just time consuming, and I'm looking for jobs at the moment, so I'm not on as much, and I don't have that much time to do things.

But, I have picked up JDroidLib again, and added some new features!
Basically, I've re-written the entire thing in under a day, because the code that was originally in there was real messy and I thought I may as well.

The new features include:
Code:
Device listing
Comand execution (now made really simple and squashed into two-three methods)
Rebooting the device (now one method, and uses internal enums)
I've revamped the installer, so other programs can install the binaries to their desired location, however, for operation, the default location will be used.
And (finally) I've got the Battery class, so developers can easily get battery stats!
Also, I've added a BuildProp class, which allows you to pull the file to a location on the HDD, read individual props and push the file back!
Currently, I'm sorting out the CPU class, which will, similarly to the Battery class, get CPU info, like currently running processes and CPU load.

So, check out the GitHub repo, and watch it to get the latest stuff!
Feel free to add your own code, classes, whatever and I can't wait to release this puppy into the wild! (Metaphorically speaking, that is... )


My popular projects on GitHub
Universal Android Toolkit is now in BETA, JDroidLib is released!


My work (other) work:
"Nothing is infinite, except human stupidity." - Albert Einstein.
"You shouldn't trust everything you see on the internet." - Abraham Lincoln.

If you haven't already, add me to your circles on Google Plus

The Following User Says Thank You to Beatsleigher For This Useful Post: [ Click to Expand ]
Tags
adb, android, fastboot, java, multi-os
Thread Tools
Display Modes