I have an activity that requests a landscape mode.
However with some tablets, the reverseLandscape should be used.
That's why I'd like to use the sensorLandscape screen orientation, but it is only available for API 9+.
Mine is level 7, and if I change it I will loose a big part of users.
How is it possible to do this feature with API level 7 please ?
Thanks...
Related
What's the meaning of v19 behind drawable? for example: drawable-hdpi-v19?
Thanks!
Table 2 in doc describes all possible options for res folders.
v19 means at least API19 (4.4)
It describes the API Level. In this case API 19+ (Android 4.4)
That is probably because of the updated Design guidelines. For example touch:
Touch feedback
Before Android KitKat, Android's default touch feedback color was a
vibrant blue. Every touch resulted in a jolt of high-contrast color,
in a shade that might not have mixed well with your brand's color(s).
In Android KitKat and beyond, touch feedback is subtle: when something
is touched, by default its background color slightly darkens or
lightens. This provides two benefits: (1) sprinkles of encouragement
are more pleasant than jolts, and (2) incorporating your branding is
much easier because the default touch feedback works with whatever hue
you choose. Check the updated Touch Feedback page for more details.
The API level of the resource (v19 -> 19+ kitkat 4.4).
You could use it for drawable, values, xml etc. for every resource.
The API level supported by the device. For example, v1 for API level 1
(devices with Android 1.0 or higher) and v4 for API level 4 (devices
with Android 1.6 or higher). See the Android API levels document for
more information about these values.
My app target 2.2 and later and want to support orientation only on portrait and reverse portrait. and the problem is i can't declare
android:screenOrientation="reversePortrait"
in manifest as it is only available from api level 9.
How is it possible to do this by supporting android 2.2 and later.
According to this post,
How to detect exact orientation of device in Froyo?
it is not possible to use portrait mode with reversed API 8.
Find below what google has to say for making an application tablet optimized in its latest Google IO-13 initiatives. My question is :- Why do my app has to have min sdk version greater than 11 to make it tablet optimized? This means my application is not for tablets if I am supporting gingerbread phones which is still active in lot of devices.
At a minimum, check the element to make sure that:
targetSdkVersion is declared with value 11 or higher (14 or higher is recommended), OR
minSdkVersion is declared with value 11 or higher.
If a maxSdkVersion attribute is declared, it must have a value of 11 or higher. Note that, in general, the use of maxSdkVersion is not recommended.
From the <uses-sdk> documentation:
[...] setting [the targetSdkVersion] value to "11" or higher allows the
system to apply a new default theme (Holo) to your app when running on
Android 3.0 or higher and also disables screen compatibility mode when
running on larger screens (because support for API level 11 implicitly
supports larger screens).
There are a few key things to note here.
You don't need to set minSdkVersion to 11. They suggest setting either minSdkVersion OR targetSdkVersion to 11. Doing either will have the same effect for tablets.
You can have an application that runs on tablets just fine without doing this. It simply will use screen compatibility mode, which is not optimal.
If you aren't targeting a higher API version (or implicitly doing so with minSdkVersion), then your app will also not use Holo (without a library), which is a standard UI expectation for apps on newer (3.0+) devices.
I have an issue with my android app when i use android:configChanges="orientation". I want to prevent reloading activity after changing acreen orientation (above xml param works in other app) but this time it fails.
The thing is, that i want my activity (SherlockActivity) to keep portrait on start, but after OnClickListener event i need to enable it with:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
Is there any other method that should be run to prevent that reload?
The android:configChanges parameter should work (it worked for me flawlessly). Just a blind guess - if you're targeting API level 13 or higher, you also have to include screenSize:
Caution: Beginning with Android 3.2 (API level 13), the "screen size"
also changes when the device switches between portrait and landscape
orientation. Thus, if you want to prevent runtime restarts due to
orientation change when developing for API level 13 or higher (as
declared by the minSdkVersion and targetSdkVersion attributes), you
must include the "screenSize" value in addition to the "orientation"
value. That is, you must decalare
android:configChanges="orientation|screenSize". However, if your
application targets API level 12 or lower, then your activity always
handles this configuration change itself (this configuration change
does not restart your activity, even when running on an Android 3.2 or
higher device).
(excerpt from here)
I have struggled to find out why we are seeing our app show flashing map tiles on ICS devices (works fine on pre-ICS devices). I eventually narrowed it down what appears to be a problem with the API's on API level 15 devices when a minimum sdk level is set in the manifest (see steps to reproduce and sample code below).
Has anyone else seen this problem and even better know if there is a workaround?
Steps to reproduce:-
Use the Google sample MapDemos from API 15 SDK Samples add-ons/addon-google_apis-google_inc_-15/samples
Import the sample to eclipse and build it as is with Project Build target set to 15 , launch the app with device in portrait orientation and show the MapViewCompassDemo view - rotate the device to landscape and notice all works well.
Change the manifest to set the minimum sdk to 15
add:-
<uses-sdk android:minSdkVersion="15" />
Re-build the app with Project Build target api still set to 15.
Launch the app , select the MapViewCompassDemo view and rotate from portrait to landscape mode (forcing a resume) and note that map tiles in various parts of the screen start flashing grey continously (re-loading - log file shows it continuously fetching new data via http).
Setting the minSdkVersion to lower levels (e.g. 11) and building with the Build target set to 11 reproduces the same problem.
This problem manifests more readily when the zoom is set further in e.g. 10 iso 8 as in the sample code.
This was reproducible on the Samsung Galaxy III, and II and Galaxy Tab Tablet on ICS (4.0.3).
Finally got an answer from Google on this :-
The original Google Maps library for Android is now deprecated and you should use the new V2 API discussed here:
http://android-developers.blogspot.com/2012/12/new-google-maps-android-api-now-part-of.html
Bugs for that API should be filed here:
http://code.google.com/p/gmaps-api-issues/issues/entry?template=Android%20API%20v2%20-%20Bug
How funny!