First, I've upgraded to API-21 including eclipse android toolkit and SDK.
I want to use the fragment feature and still want to support those 2.x phones
I know that I must use support library - v4.
But the problem is when I create an Android project, it always shows "Navigation Type "Scrollable Tabs + Swipe" requires a minimum SDK version of at least 11, and the current min version is 8".
How could I solve this tricky problem?
======================================
My settings:
Minimum required SDK: API 8
Target SDK: API 17
Compile With: API 17
======================================
Thanks!!
Eclipse's project templates make use of features that require a number of APIs (mostly ActionBar), which are not provided by the support library. While you can use Fragments, with the support library, you don't have the other features associated with the APIs.
You could still implement swipe/scroll tabs by yourself though. However, you will have to create them manually (and not using Eclipse's built-in project templates).
You will need to use android.support.v4.view.PagerTabStrip, android.support.v4.view.ViewPager and android.support.v4.app.Fragment. The documentation is pretty clear and should point you in the right direction.
Related
I'm using the google places SDk which I'm aware has deprecated. I'm using the AutoComplete functionality but constantly get errors that state there is a network error and the resolution is null. Is this because of the deprecation? Does it make a difference if my API Key is in my Manifest or can I store it anywhere I want (Ignore security purposes)?
You cannot use the deprecated Places SDK anymore. You'll need to migrate to the new Places SDK for Android if you want to continue using the Places service; there's no way you can get the deprecated SDK to work by this time.
Check out What are the consequences of not migrating to the new released google places sdk
Note that you'll also need to migrate to AndroidX if you haven't done so yet either.
Hope this helps!
I'm new to Android X library which seems a next version of original Android Support Library. And I decided to migrate my existing project to Android X.
I've got multiple application modules in a single project. There are about 20 application and library modules. As per the guide, I'm trying to enable Android X.
My question is if there is any way to enable Android X for the specific module, not for entire project.
Simple way is to Right Click -> Refactor -> Migrate to Android X
According to the docs, you CAN NOT have both AndroidX and Android Support libraries in your project.
It's either all are AndroidX libraries or all are Android Support libraries.
AndroidX is just the newer version.
But an important point to note is that thought 'Migrate to Android X' refactors libraries as well as the view tags you used, it still can leave some gaping holes.
When I migrated, my RecycerView in Activity.java was useless.
Should something similar happen, don't worry
In java, just try working with importing the relevant androidx packages, that's what solved for me. Though this isn't a frequent issue
Actually, my app features are split into android library and I choose the feature I want include at the compile time. Is it possible to have a default app with very basic features, and an on-demand installable feature shipped as APK ?
I thought I could use module feature which was made for instant app because they are like android library but can generated APK but when I tried it out, the package name was different so it was impossible to use it.
I know it's the proper way to use android feature but can I use my own tricky way ? Otherwise, is there other possibilities to achieve this ?
I'm new to android development.
I'm studying with outdated books, so I'm really confused about new methods.
I'm going to make a simple and light app which can be run even on old devices.
So when I created a new android project, I set "Minimum Required SDK" to API 8, "Target SDK" to API 22 and "Compile With" to API 22.
Does this setting mean the app can work on the devices of API 8, even though I use the methods of API 22?
I'm asking this question due to deprecated methods.
I completed almost a half of my app developing using deprecated ones.
Can I just replace them all with new ones?
Or do I have to prepare multiple codes using different methods to support different platform versions?
(deprecated methods for older versions, and new ones for newer versions?)
Does this setting mean the app can work on the devices of API 8, even though I use the methods of API 22?
Yes. min sdk version is used to restrict the devices running OS with API level < minsdk from using app. Your app won't be shown in the play store for those devices.
I'm asking this question due to deprecated methods.
I haven't faced any issues till now due to depreciated methods. However, I would suggest to use min sdk version as 14 as Google has introduced many UI tweaks and enhancements. If you do some market research, using minsdk version = 14 would cover around 85% android market.
Can I just replace them all with new ones?
Yes, you can.
Or do I have to prepare multiple codes using different methods to support different platform versions?
(deprecated methods for older versions, and new ones for newer versions?)
You can do it also. Older versions do not have support have fragments. Fragments improve user experience drastically for tablets. Similarly, material design for Lollypop devices is awesome. Thee are few examples where you can opt for API level specific implementation. However, it is better to switch for api level >= 14
To clear up your confusion:
Minimum Required SDK
The minimum version of Android you're going to support. To target the largest market share, I recommend API level 14 or above.
Generally, the lower the number, the more Android devices you're targeting.
Target SDK
Basically, all this is saying is what SDK have you tested your app with. If that's KitKat then you can write in the number 19 which is the API number of KitKat, for example. You can find a list of API numbers here. As you test your app with higher and higher versions of Android, you can increase that number.
Setting the Target SDK to be a higher number will mean that you target a lot more devices.
Compile With
Specifies what API number of Android you want to compile your app with.
By default this is the latest version of Android available in the SDK Manager. Should be set high to improve user experience.
Deprecated Methods
As to your question about deprecated methods: You can continue using them. They are deprecated in favour of a newer alternative that may or may not be better in terms of functionality.
Deprecated methods will still work, the deprecated keyword just tells you that there is a newer preferred way to do it. Android is really good at backward compatibility so something compiled for API level 8 should mostly work on newer devices to.
You're going to have to use multiple code branching on version. You can check your system version at runtime like this:
private void setUpActionBar() {
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
API 8 is really old. Have a look at the version pie chart
You can find more information about this on the Android developers website
I need the sourcecode for these libraries:
commons-codec-1.3
commons-httpclient-3.0.1
commons-logging-1.1
log4j-1.2.14
jaxb-ri-2.1
I need the code to recompile it in eclipse in android app and use it with javax.xml packages as you know javax.xml can not be used in eclipse in an android project.
All of this is to use the Amazon-EC2 SDK to access them from android mobile.
all of thes is to use amazon-ec2 sdk to access them from android mobile
Your list of JARs is incorrect. The current AWS Java SDK does not use log4j or jaxb, but does use other libraries.
You may better served finding another way to access the Amazon AWS API that requires fewer third-party dependencies, such as typica, or simply invoking the query API directly using HttpClient.
All of this is to use the Amazon-EC2 SDK to access them from android mobile.
AWS now provides a dedicated AWS SDK for Android developers. I would take a look at this as it may provide the functionality you need without you having to satisfy a lot of other dependencies.