How to create custom sdk with android hidden api - android

i'm trying to use some classes from android's hidden api, but i can't use it in default android studio. So i decide to do some custom and make sdk with hidden apis with this instruction click. I tried to get framework.jar from 3 emulated devices and 1 physical, but in all cases it was about 1kb (api 28).
So the questions: how can i use hidden api in android studio without reflection? Is it possible to make custom sdk with hidden apis in 2023?

Related

Open Mobile API with Android 21+

I've been using Open Mobile API for sometime now, and I'm targeting the version for Android API 19 (downloaded from Android SDK manager by adding the link to it http://seek-for-android.googlecode.com/svn/trunk/repository/19/addon.xml), but I can't find versions above 19. Do they even exist or I just didn't search well?
You can find the latest version of the Open Mobile API on GitHub: https://github.com/seek-for-android/
There no longer seems to be a dedicated SDK integration available. However, when looking into apps that use the OMAPI, the typical way of integrating it into applications seems to be to directly integrate the library (or even directly include the OMAPI source files) instead of linking to the version of the library that is shipped with devices implementing the API. That way, you can easily tarket whatever API level you want.
For the latest version, you can find these files here: https://github.com/seek-for-android/platform_packages_apps_SmartCardService/tree/android-5.0.0_r3-scapi/openmobileapi
The API should be backward compatible, so if you integrate the latest version you should be able to access older implementations too (though only a limited set of functionality would be available).
Update on 2015-09-23:
There still is an SDK integration available. It is described in the SEEK Wiki: Using Smart Card API.
As of today, there are SDK integration add-ons available for
API 21: http://seek-for-android.github.io/repository/21/addon.xml
API 19: http://seek-for-android.github.io/repository/19/addon.xml
API 18: http://seek-for-android.github.io/repository/18/addon.xml
API 17: http://seek-for-android.github.io/repository/17/addon.xml
API 15: http://seek-for-android.github.io/repository/15/addon.xml
All updates to this list should be reflected in the seek-for-android.github.io repository on GitHub.
From Android P, the Open Mobile API is part of the Android framework. The previous answers are therefore obsolete for newer devices.
See https://developer.android.com/reference/android/se/omapi/package-summary for details, and note that there are some minor changes compared to older versions. In particular:
Different namespace (android.se.omapi).
Addition of Transaction Event support.
Changes to SEService Listener, which must implement the onConnectedListener interface
No support for Reader Event callback.
Channel class extends java.nio.channels.Channel. This implies a new methood, isOpen() which replaces the isClosed() method.
No support for setTransmitBehaviour()

Can you use images from a data stick in an android app?

I am designing and implementing an android application which is basically a survey with the capability to insert images and audio files.
What I am wondering is, is it possible for the android app to insert images directly from a USB data stick into a form?
Furthermore any pointers on how to do this, or to resources would be greatly appreciated.
Android 3.1 or later devices (API level 12 or later), or Android 2.3.4 (API 10) with the compatibility library, support reading from USB sticks IF the hardware supports it (i.e. if the manufacturer added the support), which usually means recent devices that support OTG (On-The-Go), usually via an OTG adapter. Apps need "android.hardware.usb.host" uses feature in manifest and must handle USB_PERMISSION.
Start with the developer info: https://developer.android.com/guide/topics/connectivity/usb/host
which doesn't give detail on the code to actually access files. libMedia is a commercial library that has a class to access sticks. If you can see the USB drive in a file explorer App you may be able to access it with file IO code using directory names such as /mnt/sda1/, /mnt/sda/sda1/, /udisk/, /mnt/udisk/. The file explorer should show the path.

Android Development, SDK Version

First time developing for Android.
I've noticed that the latest SDK is v4.x but I've noticed informally that most people are running v2.3
If I develop an app using the 4.x SDK. will it refuse to run on 2.3 phones? Or will certain features be disabled?
Should I develop using the 2.3 SDK instead?
Before answering the question, something should be cleared up: There's a difference between the version of Android (2.3, 4.x, etc) and the version of the API it runs on (which is ALWAYS an integer: 10,11,12, etc). The relationship between Android platforms and their respective API versions can be found on this page. By way of example, Android 2.3 uses API 10, and Android 4.0 uses API 15.
Furthermore, there's only one SDK, which has downloadable modules for coding against various versions of the API. So it's not that you're using v4.x of the SDK, it's that you're using the SDK, period, and coding against version 15 of the API :).
That said: The best thing to do is set minSdkVersion to the minimum version of Android your application will run on, and set targetSdkVersion to the most current version of Android. Then you can use Build.VERSION_CODES to check for new versions of the platform at runtime, and activate new platform features as necessary. A good tutorial on how to do this is on the Android Developer blog, titled How to have your cupcake, and eat it too.
I would even recommend targeting 2.2 as I still have a large number of users (16%) running Android 2.2. Here is a break down of on one of my apps that shows what version users are currently running. (See attached picture). Like J. Maes said the lower you can build it the more users you can capture. Although there are trade-offs that you will have to make by using an older SDK. For most purposes I haven't had much of an issue targeting 2.2. It allows me access to a larger customer base.
You should use the lowest version that supports all the features you want to use in your app. If you think a 4.x feature is absolutely necessary in you app, then you should use it. If not, use 2.3, so more people can run it as Android is backwards compatible.

Can Android 4.0 apps work with Android 2.0 and Android 3.0 devices?

I plan on creating an application for users to view their stats of a game I am currently in the process of making but my question is like the title. I am not sure if phones with Android 3.0, Android 2.0 or lower can use the apps? If not, how would I work around this? Would I just not be able to use the new API features such as NFC etc? All in all, if I start developing with Android 4.0 SDK, will all android phones be able to use my app?
My understanding of android development, is that you can build against a lowest common denominator if you build a single package, and it will run on that version, and most likely any newer version. But not the other way around.
The compatibility library (which we're now just calling the support library) doesn't use any special magic to pull this off. You can check Build.VERSION.SDK_INT at runtime and use classloader guarantees to access newer functionality when it's available. Some examples are here: http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html
We recommend taking a graduated approach to supporting different platform versions. Provide a simpler version of your UI on older versions and layer features on top as they become available. The link above gives some examples of how to do this, and we're going to continue expanding the support library with more *Compat classes that do the version checking for you when using newer features that may or may not be available on all devices you want to support.
Chris is right. However this can be limiting. What if you want to be flexible and use features of the 3.0 and 4.0 android in you app if the device you're running on has them and then gracefully fallback if they don't? Enter the android compatibility package. You can do development using really old api's (all the way back to 1.6) and still have access to new api features.

Android how to use new features of 2.2 and still keep code compatible with 2.1 api

I would like to use push notification (available from 2.2 onwards) for my app. But I would also like to keep my app compatible for devices with 2.1 API. How do I do it
You should try the method shown here.
Keep two separate wrappers for both versions on your app then load the appropriate wrapper on app init based on the firmware version.

Categories

Resources