Android application just for tablets? - android

Is it posible to make my app to install only on tablets ??
I tried with minsdk version, but it doesn't work, because there is tablets with froyo, and now ICS is out :(
I tried with support screen, with setting small , normal and large to false, but HTC flyer is large screen and it is not supported :(
So my question is is it posible to make app for just tablets, but to include tablets with 2.2

The problem is that there is not a clear distinction between tablets and other devices. Some devices are clearly phones while some others are clearly tablets. But, the Samsung Galaxy Note is a phone or a tablet? Same for Dell steak 5, and many others.
Currently, last generation phones have screens of 1280x720, having more pixels than some low end 8" tablets.
You can not distinguish either based on the default orientation (landscape / portrait) since you can find both default orientations in both kind of devices.

Related

Android Galaxy S4 uses values-large?

Problem:
I am testing my app using the Eclipse/ADT bundle. On an AVD created to emulate the Galaxy S4 (a device defined as being "normal" in size) the OS is selecting the XML files from the values-large folder.
The Android operating system is ignoring all other values folders I have defined in an attempt to differentiate the S4 from tablets.
Given the following folders, it selects the values-large folder for the S4:
values-large
values-sw720dp
values
values-normal-hdpi
values-normal-mdpi
values-normal-xhdpi
values-normal-xxhdpi
values-normal
The problem is that I have Master/Detail (ListFragment/Detail-Fragment) two-fragment display that only displays correctly on large screens (tablets). It does not display correctly on the S4, because of the device's size. On a device smaller than 6" wide, the icons end up getting displayed on top of the text, instead of to the right of the text. The only difference is with the S4 in landscape orientation.
The S4 is the ONLY normal sized device that can show the two-pane layout in landscape orientation. The Nexus 4 and others cannot. In landscape the extra density of the S4 is what makes it work.
I also don't want the S4 to use the dimens.xml file that is in the values-large directory.
Questions:
Is this normal/expected behavior? Does the OS classify the S4 as a "large" device? The OS has ignored every other folder name I have tried to use to target the S4. So, it prefers the pre 3.2 names over the newer ones.
In other words, when I attempt to use the newer folder names, like values-sw720dp, the OS still chooses the large folder.
I have two AVDs. One I created to match the specs of the S4. The other is the Sony Xperia Z1, that has the same specs and is available when you install the Sony SDK. Both AVDs are setup with size=normal. I have checked each to makes certain there is no mistake in their setup.
Thanks.
EDIT
I have a new LG G2, which is similar to the S4 in size and density. It does NOT use the values-large directory. I think it is using values-normal-xxhdpi, but need to run more tests (changing dimension values in the dimens.xml) to see what directory it is choosing.
values-large etc are deprecated with android 3.2 (?). It was replaced with things like values-sw720dp and there is basically not a single device out there running android 3.0 or 3.1. Any device running android 2.x is most likely a medium sized phone.
This means, there is no need of using this old qualifiers.
values-sw720dp means, smallest width = 720dp I doubt, your S4 is that wide.
You should use a qualifier like values-w720dp, which means width = 720dp where width depends on your current orientation.
It's way better than relaying on port or land combination because it shows the two pane layout for large displays having 720dp width in portrait orientation too.
Master/Detail two-pane layout for large screens (any orientation)
That seems fine. The implication is that you will use this for -xlarge as well as -large.
and medium screens with high dpi in landscape orientation
First, I do not know what "medium screens" are, as that term is not used in Android development.
Second, I have no idea why you think this would be appropriate. Screen density should not impact the decision of whether to show one or two panes. I would be interested to know applications, written by experts, you see taking this approach.
At first I thought it was the second folder (sw720dp) causing the problem
Note that you have not stated what the problem is.
The Sony Xperia Z1 AVD
I am not aware that SONY distributes emulator images for their devices.
does the same thing as the S4 AVD
I am not aware that Samsung distributes emulator images for their devices.
Is there a values folder I can use to make the Galaxy S4 not choose Master/Detail at all, but still allow tablets to use it?
Ignoring your "medium screens with high dpi in landscape orientation", use -large or -xlarge for tablets. The Samsung Galaxy S4 will not use -large or -xlarge resources, as it is a -normal device. This was confirmed using both the GT-I9500 and the SGH-I337 versions of this particular model.
Is there a way I can make it use Master/Detail for the S4 only when in landscape?
You can use -normal-land to identify -normal devices in the -land orientation. Note that screen size (-normal) is a bit of a fuzzy match, in that Android considers that valid for devices in that size class or larger. Hence, -normal-land would be used by -large-land and -xlarge-land devices as well, in the absence of better matches.
(Note that density qualifiers are even fuzzier -- -mdpi will be used for any device density, in the absence of a better match, as density qualifiers are designed to be used only on drawable directories, where Android can apply resampling algorithms. Using density qualifiers on anything other than drawables and maybe dimension resources is a code smell.)
Personally, I would not use a dual-pane strategy for -normal-land devices, as -normal goes all the way down to 3" diagonal.
This is all in the Eclipse/ADT bundle using the emulator.
My guess is that this is where your problems are coming in.
Unless you downloaded something from a device manufacturer (e.g., Amazon with their emulator images for the Kindle Fire series), NEVER say that you have a "Sony Xperia Z1 AVD" or a "S4 AVD". You are lying to us and, worse, you are lying to yourself. At best, you have an emulator image that you think that you have configured to match the specifications of those devices. However:
That assumes you got the configuration correct
That assumes that the device manufacturer has not changed the behavior of their device at the firmware level
That assumes there are no emulator bugs
You are certainly welcome to say that you are testing things on -normal -hdpi emulators, or the like, as those are things that you directly control via the Device Definitions tab of the AVD Manager.
After reading your comments, I noticed you said you said the Galaxy S4 screen size you defined was 4.9"? All the specs I've seen say it's 5" which will actually change the size in Device definitions from "normal" to "large" once you correctly set the S4 and Nexus 5 to 5".
Edit the Galaxy S4 emulator's definitions to 5" so you have the right screen size, it will auto-change the size to large, so you will need to decide if you need to switch it to normal then go from there. Also, for those wondering, once that avd starts, it does say that it's pulling from the sw480dp folder, so in your case, you would need a new folder:
values-sw480dp or to eliminate large devices in this bucket, values-normal-sw480dp

Titanium Android - How to differentiate between a smaptphone and a tablet?

I'm using Titanium SDK 2.1.3 and I've come across this problem recently, since Android 4.0 and greater can be found in both smartphones and tablets, how can I differentiate between them? If I try to distinguish based on resolutions it wouldn't work right, since some high end smartphones have smaller screens but higher screen resolutions, while some tablets have bigger screens but smaller resolutions.
The app I'm working on work should be displayed in portrait on smartphones, in the case of tablets it should be shown in landscape.
What's the right approach to differentiate between a tablet and a smartphone?
Thanks for any help in advance.
I found a module that calculates the screen size of the device based on the number of pixels per inch, though not 100% accurate it works, this is the link

Need to differentiate with 10 inch tabs of different resolutions

I have a requirement in android to support my app in different tablets like google nexus 10 and samsung galxy 10 inch tablet. Nexus 10 is double the resolution of samsung 10 inch tab. I need to place different images for nexus 10 to make my app looks with better clarity for nexus 10 . But both the devices are taking the image from the drawable-xlarge. How can I differentiate between these two devices in drawable level and layout level. Same case is applicable for phones as well where I need to differentiate Samsung galaxy s4 which is double the resolution of xhdpi phones.
-xlarge is a screen size qualifier. Your drawable folders should use screen density qualifiers (-mdpi, -hdpi, -xhdpi, -xxhdpi). If you must, you can use both, e.g -xlarge-hdpi
Don't forget the new smallest width qualifiers. They are of a great help when you need to differentiate based on screen resolution.
I wouldn't consider a non-Nexus tablet anymore, based on how bad manufacturers have been at bothering to update them. The Nexus devices being "Official Google" devices and getting updates from Google means that they're going to be updated for a long while going forward, and once that ends, you can still unlock and root them through a defined process & update things yourself if you care to do so.
I can't think of any 10" Android tablet I'd have other than the Nexus 10. They're really that good.

How to create layout for devices with screen resolution=720x1280, density=xhdpi and size=normal?

I am developing an Android application intended for high end handset devices like Galaxy S3, Galaxy Nexus, Xperia V etc. Now I want to know which layout is suitable for devices with resolution 720x1280, density xhdpi and size normal.
I already tried layout-xhdpi-1280x720 and Galaxy S3 device is loading screens from here, but not Galaxy Nexus.
I have tried layout-sw260dp but Galaxy Nexus emulator do not loading screens. Also Nexus7 is emulator is loading from here. I don't want any tablet to run my app.
What can be the problem ? Does Device definition of Galaxy Nexus causes the problem ?
I am using Android SDK 4.2.
Now I want to know which layout is suitable for devices with resolution 720x1280, density xhdpi and size normal.
res/layout/ works nicely. If you are also supporting -small screen devices, have an additional res/layout-small/ for those. You may or may not also wish -land variants (e.g., res/layout-land/) if you want different layouts for different screen orientations.
I already tried layout-xhdpi-1280x720 and Galaxy S3 device is loading screens from here, but not Galaxy Nexus.
That approach has been deprecated for years.
I don't want any tablet to run my app.
Then specify the appropriate <compatible-screens> element in your manifest, to state that you only support small and normal screens, not large and xlarge. This has nothing to do with your choice of layout resource directory.

Why does an Android 2.3.3 7 inch tablet use xlarge resources?

My app has different layouts and styles for xlarge screens. This is important because on phones it is only used in portrait and on tablets it is only used in landscape.
A user contacted me a few days ago because since I published the update with the tablets layouts he can't see some of the objects in my main activity (prior to this update I only had portrait layouts - also on tablets). He uses a 7 inch tablet running Android 2.3.3 and for some odd reason it is using the layouts and styles from the xlarge directories even thew it should use the default layouts and styles.
I tested it on the emulator and had the same problem. I then changed only the android version to 3.1 (did not change width, height and density) and it worked as expected - the default layouts were used.
I don't want to use version qualifiers (layout-xlarge-v13) because then users with old android versions that have an xlarge screen will get the wrong layouts. For android 3.2 and up I could use sw720dp but older versions will not use this so problem remains.
I am able to tell at run time that the device is not large enough for the xlarge layouts but what can I do in that situation? Is there a way to make it use the default resources?
Android doesn't give its blessing to any 7-inch tablets running Gingerbread or below since Honeycomb was released. This means your device must be either old, or non-CTS compliant. You are looking at an extremely small pool of devices that are: API level 7-10 (roughly), 7-10 inches in size, that live outside the main Android ecosystem.
If you want to support such devices, I would recommend that you make layout-large-v7 and layout-large-v11. Assume that these nonstandard tablets will select the first one, and design for low- or medium-density 1024x600-pixel displays.

Categories

Resources