I am a new android developer. I want to develop an app which can access SIM Tool Kit in android mobile. But I haven't found the exact solution online. I found 2 examples:
https://github.com/android/platform_packages_apps_stk
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.4.2_r1/com/android/stk/StkLauncherActivity.java?av=f
when I import com.android.internal.telephony.cat.Duration class in ADT, it does not find it.
I also found this class here:
https://android.googlesource.com/platform/frameworks/opt/telephony/+/e005c3c44109c9b4a8d25f05e8b7133d5ef55ead/src/java/com/android/internal/telephony/cat/
But I am not able use it.
If you were to google a little bit, you'd find out that this is impossible.
com.android.internal.telephony.cat.Duration has an #hide annotation that means it's not accesible through the SDK
The whole internal package is meant to be internal, i.e. used by android not by developers.
STK itself is not accessible to external apps
However there's also reflection which may be used to access hidden methods. Though I didn't bother to try, this might help.
Related
I would like to determine which third-party SDKs (like Mixpanel, Google Analytics, Facebook SDKs) are being used in an app, if any. Is there a way to find this out?
Assume for the purposes of this question that I am not the developer of the app, and therefore I don't have access to the source code.
You can use a service like Appbrain to find that out. It's free for the first few lookups.
It's not possible to reliably enumerate the libraries used by an application, for a few reasons.
The main reason is obfuscation: If a user turns on Proguard or R8, they will rename the library's classes, potentially in such a way as to make them unrecognizable.
Another reason is that there's simply not a comprehensive list of every Android library in existence, or a mapping of class names to libraries.
However, if you did want to try to do this, you'd want to retrieve the application's class files and then hunt through them for the start of package names from libraries you care about (as obfuscators are less likely to rename the entirety package names, though they still might). For example, if you wanted to see if an application uses okhttp3, you'd look to see if there are is an okhttp/okhttp3 folder (for the package okhttp.okhttp3).
You could maybe even automate this by finding a list of popular Maven/Gradle packages, downloading them, extracting the class names, and using that as your dataset.
I found this Image on the web and want to use a such list in android. Do you have an idea where I can find a such List in Android Studio?
There are certain lists that others have provided as free source code to be used within your applications. What you have discovered is not a built-in feature of Android (the IDE has not relevance on this).
You can however find resources to use a wheel such as those. One of which used in the past has been from the android-wheel code. Most will demonstrate examples and provide useful tips on going forward with implementation. But you can find others if you look hard enough.
It seems that this class is not public, and I have to access TELEPHONY_STATUS variables in this class because I see in android source code that the values can change considering what api version you are using.
Read this post from the android-developer mailing list.
android.provider.Telephony is part of the Open Source releases, but never included as part of the Official SDK.
You can view it, to understand how the system works, but you can't actually use it in your apps.
As it says in the post,
No, it does not appear in the SDK, and this means
you should not try to use it from your applications.
I'm quite the beginner to programming in general (and esp. Java!), so I'm having trouble figuring out how to interact with the unofficial Android API library, shown here:
http://code.google.com/p/android-market-api/
One of the snippets of example code say "see AppsResponse class definition for more info". However, how am I supposed to do this? There are two .jars provided, one of which corresponds to the Android Market API. Upon extraction with WinRAR (I'm on Windows, by the way), I go in a few folders deep and find a bunch of .class files. How do I open this to read, and figure out how to interact with the API? Thanks!
You can just look at it from the source?
http://code.google.com/p/android-market-api/source/browse/trunk/AndroidMarketApi/src/com/gc/android/market/api/model/Market.java
Can anyone tell me, how to import Android hidden/internal API's into my application?
For example, com.android.internal.telephony. How to import this APi into application?
Thanks in advance.
If the classes are available at runtime, but not compile time, yes you can't compile against them directly in your code but you can still try to load them via reflection. We used this in Android 1.x to load a hidden internal class that controlled the LED light on some devices. It is difficult since every method call turns into several lines of calls to java.lang.reflect classes. See here:
http://www.google.com/codesearch#k59QJW14udA/android/src/com/google/zxing/client/android/camera/FlashlightManager.java
Of course, these APIs or classes would not at all be guaranteed to be present on all devices, and could change or disappear, so this is brittle. And it may be that there's a SecurityManager protecting access to certain internals too, I don't know.