Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

dp units not working on low dpi devices

$
0
0

I'm working on a mobile app using alloy and I'm using dp units for supporting different screens, but something is not working properly as the UI is not being scaled when running the app on a low dpi (160) device.

The following images show how the app is being displayed and properly scaled in several different devices. All screenshots were taken from genymotion emulated devices.

Samsung S4 - 4.2.2 - API 17 - 1080 x 1920 - 480 dpi

alt text

Samsung S3 - 4.2.2 - API 17 - 720 x 1280 - 320 dpi

alt text

Samsung S2 - 4.1.1 - API 16 - 480 x 800 - 240 dpi

alt text

Google Galaxy Nexux - 4.3 - API 18 - 768 x 1280 - 320 dpi

alt text

Samsung Galaxy Note 3 - 4.3 - API 18 - 1080 x 1920 - 480 dpi

alt text

Sony Xperia Tablet Z - 4.1.1 - API 16 - 1920 x 1200 - 320 dpi

alt text

The problem is it is not working properly on 160 dpi devices as the ui looks too small and it seems it is not being scaled.

Sony Xperia Tablet S - 4.1.1 - API 16 - 1280 x 800 - 160 dpi

alt text

Custom Phone - 4.3 - API 18 - 768 x 1280 - 160 dpi

alt text

I have tested it in real devices and I'm having the same issue: It's displaying well in my samsung S phonesbut it is not working on my samsung galaxy note.

Does anyone know what am I doing wrong or what am I missing? This appear to be an android only issue because it is also working properly on ios.

This is the code of the manifest tag in tiapp.xml

<manifest>
            <!-- Allows the API to download data from Google Map servers -->
            <uses-permission android:name="android.permission.INTERNET"/>
            <!-- Allows the API to cache data -->
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
            <!-- Use GPS for device location -->
            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
            <!-- Use Wi-Fi or mobile connection for device location -->
            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
            <!-- Allows the API to access Google web-based services -->
            <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
            <!-- Specify OpenGL ES 2.0 as a requirement -->
            <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
            <!-- Replace com.domain.appid with your application ID -->
            <uses-permission android:name="com.vivelabbogota.guiadetramitesvivelabbogota.MAPS_RECEIVE"/>
            <permission
                android:name="com.vivelabbogota.guiadetramitesvivelabbogota.MAPS_RECEIVE" android:protectionLevel="signature"/>
            <application>
                <!-- Replace "PASTE YOUR GOOGLE MAPS API KEY HERE" with the Google API key you obtained -->
                <meta-data
                    android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyDeYN4uoAdHBo5UaoqXRceMa1ZkL5buqeE"/>
            </application>
            <activity
                android:configChanges="keyboardHidden|orientation|screenSize"
                android:label="@string/app_name"
                android:name=".GuiaDeTramitesActivity" android:theme="@style/Theme.NoActionBar">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </activity>
            <!-- Need to specify at least API level 11 for Titanium SDK 3.2.x and prior -->
            <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="16"/>
        </manifest>
I'm using .tss style sheets for the size of the elements and fonts, i'm not calculating sizes on my controllers and don't want to do it. I believe it is not something related to my project because I did a test on a completely new project and it happened there as well.

Sorry for the long post. I'm trying to be as detailed as possible as I've wasting many hours trying to figure this one out and I hope someone could understand and help me find the solution.

Thanks for your help.


Viewing all articles
Browse latest Browse all 8068

Trending Articles