Stericson / RootTools

RootTools Library
1.61k stars 486 forks source link

multiple warnings on the library #1

Closed AndroidDeveloperLB closed 10 years ago

AndroidDeveloperLB commented 10 years ago

since this library no longer have a jar file, when adding this code into another project it produces warnings that I usually use in order to help avoiding NPE:

"Potential null pointer access: The variable command may be null ..."

please check them out and see if it's really possible that NPE can be caused, or at least make the code avoid those warnings.

Stericson commented 10 years ago

There is a jar file. Look at the release section: https://github.com/Stericson/RootTools/releases

AndroidDeveloperLB commented 10 years ago

I see. please do check the warnings though:

Stericson commented 10 years ago

I will look into them.

Also keep in mind the deprecated methods is to be expected as this library works as far back as Android 1.5.

I'll def be looking into the reader issue, all of those should be closed.

AndroidDeveloperLB commented 10 years ago

also please put the link you've just written on the wiki page here : https://github.com/Stericson/RootTools/wiki

AndroidDeveloperLB commented 10 years ago

and thank you for your patience.

AndroidDeveloperLB commented 10 years ago

about the 1.5 usage, you can do a check on android version, and if it's high enough, use the new version's functions.

Stericson commented 10 years ago

Updated the front page.

I'll look into the viability of using reflection to use updated methods.

AndroidDeveloperLB commented 10 years ago

i think reflection is too hard core for this (in case you use it per function). you can simply use something like this for example

if(VERSION.SDK_INT>=VERSION_CODES.GINGERBREAD)
....

sadly it's from API 4 .

maybe put a global check of android versions, which will only use this method, and put the value using reflection.