Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP Beatsleigher

3rd December 2013, 07:03 PM   |  #1  
Beatsleigher's Avatar
OP Senior Member
Flag Somewhat around here : 52.366848,8.3345
Thanks Meter: 551
 
1,074 posts
Join Date:Joined: Oct 2011
Donate to Me
More
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!
Last edited by Beatsleigher; 30th May 2014 at 08:21 PM.
The Following 14 Users Say Thank You to Beatsleigher For This Useful Post: [ View ]
zylor
4th December 2013, 06:23 AM   |  #2  
Guest
Thanks Meter: 0
 
n/a posts
This project made it to the Home Page!

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

Congrats mate

Subscribed!
4th December 2013, 01:28 PM   |  #3  
Beatsleigher's Avatar
OP Senior Member
Flag Somewhat around here : 52.366848,8.3345
Thanks Meter: 551
 
1,074 posts
Join Date:Joined: Oct 2011
Donate to Me
More
Quote:
Originally Posted by zylor

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
4th December 2013, 02:46 PM   |  #4  
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.
The Following User Says Thank You to AdamOutler For This Useful Post: [ View ]
4th December 2013, 02:50 PM   |  #5  
Beatsleigher's Avatar
OP Senior Member
Flag Somewhat around here : 52.366848,8.3345
Thanks Meter: 551
 
1,074 posts
Join Date:Joined: Oct 2011
Donate to Me
More
Quote:
Originally Posted by AdamOutler

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.
The Following 2 Users Say Thank You to Beatsleigher For This Useful Post: [ View ]
18th December 2013, 12:29 AM   |  #6  
cybojenix's Avatar
Recognized Developer
Thanks Meter: 1,580
 
834 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by Beatsleigher

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
18th December 2013, 11:15 AM   |  #7  
Beatsleigher's Avatar
OP Senior Member
Flag Somewhat around here : 52.366848,8.3345
Thanks Meter: 551
 
1,074 posts
Join Date:Joined: Oct 2011
Donate to Me
More
Quote:
Originally Posted by cybojenix

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
18th December 2013, 04:33 PM   |  #8  
cybojenix's Avatar
Recognized Developer
Thanks Meter: 1,580
 
834 posts
Join Date:Joined: Apr 2012
Donate to Me
More
Quote:
Originally Posted by Beatsleigher

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
18th December 2013, 04:50 PM   |  #9  
Beatsleigher's Avatar
OP Senior Member
Flag Somewhat around here : 52.366848,8.3345
Thanks Meter: 551
 
1,074 posts
Join Date:Joined: Oct 2011
Donate to Me
More
Quote:
Originally Posted by cybojenix

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
26th February 2014, 10:02 PM   |  #10  
Beatsleigher's Avatar
OP Senior Member
Flag Somewhat around here : 52.366848,8.3345
Thanks Meter: 551
 
1,074 posts
Join Date:Joined: Oct 2011
Donate to Me
More
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... )

The Following User Says Thank You to Beatsleigher For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
adb, android, fastboot, java, multi-os
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes