Questions tagged [density-independent-pixel]

DIP is short for Density Independent Pixel. It is used by the Android system as a unit of measurement to make GUIs fit on different screen sizes with scaling. This allows the developer to create a single interface for different screen sizes.

119 questions
0
votes
1 answer

Android - Puzzles about conversion between dp and pixel

I know this might be a silly question but I have really gone through so many materiel and links but still not quite understand it. In the "Supporting Multiple Screens" section of Android Develop Doc, it introduces dp like this: Density-independent…
0
votes
0 answers

Android harmony pixels

i will explain my problem with an image ! I draw a figure with my finger and at the same time coordinates is sent to clients.As you understand i am working with hard coded pixels.Algorithm is simple take the pixel and send to client and fill the…
hsyn
  • 55
  • 3
  • 9
0
votes
0 answers

Am I adding layouts correctly?

After doing my prior research on the top 10 handsets and tablets in my country, I can classify them as follows: HANDSETS: 533dp x 320dp 640dp x 360dp 853dp x 480dp TABLETS: 1280dp x 800dp 960dp x 600dp So, given that I am supporting API…
An SO User
  • 24,612
  • 35
  • 133
  • 221
0
votes
1 answer

Android Actionbar Icon Drawable

As you probably know, there are some icons on Github from Google to use. I wanted to implement a actionbar icon and saw this here(google.com/design) and this(dev.android.com). google.com/design tells me to use a 24dp icon dev.android.com sais I…
0
votes
1 answer

How do i tell if a cron job on OpenShift is working or not?

I have an OpenShift DIY cartridge so, i need to do some work daily, i read this article : Run CRON job every 5 minutes on OpenShift (Red Hat Cloud) and do it by making a file in : ~/app-root/runtime/repo/.openshift/cron/minutely/awesome_job.sh with…
soheil
  • 91
  • 8
0
votes
0 answers

App wide size units on Android?

please is there a way how to change the DP or SP scale factor globally for an application on Android? I have quite complex layout based on SPs, but I would also like to let users scale it manually..is there a way how to do that? Now they just can…
simekadam
  • 7,334
  • 11
  • 56
  • 79
0
votes
0 answers

Same layout XML for phone and tablet that has same resolution - not scaling well

I have some thought on how layout works in Android development. I have written an app for a tablet with full HD resolution (10" Xperia Z1 Tablet, 1920 x 1200). The app looks good and works well on the tablet. The app is always in landscape…
Ted
  • 19,727
  • 35
  • 96
  • 154
0
votes
3 answers

Why buttons has the same size on multiple screens (Android 1.6+)?

Please help me with one problem. When I change min sdk version from 3 (Android 1.5) to 4 (1.6) or higher, all buttons and textviews have the same size on multiple screens although I use dp and sp units. Why might this be? Simple example (main.xml):…
0
votes
1 answer

Android: 1 dip on LDPI

I'm using a view which's height is 1dip. Now I'm wondering what it will do on a LDPI screen. Unfortunately, I haven't got a LDPI screen to test on, so that's why I'm asking you guys. 1 dip on LDPI means 0.75 px. What will android do, will it show…
Xander
  • 5,487
  • 14
  • 49
  • 77
0
votes
1 answer

How do I properly size in relative layout so my content isn't stretching on larger devices?

I am new to Android programming, and I have tried to research this thoroughly, but still not quite understanding how to resolve this problem. I will include my XML code below. I have tried using set "dip" sizing in Relative Layout in Eclipse to get…
0
votes
1 answer

common UI for all the device irrespective of size

My application works fine on the handset but when I am running it onto the TAB UI becomes too small.But I want size of the UI to be relative to the size of device. Do I need to add anything in manifest .Whats wrong I am doing.Here is My XML …
Shakeeb Ayaz
  • 6,200
  • 6
  • 45
  • 64
0
votes
3 answers

How to programmatically alter an apps size, with DIP instead of PX

I've searched and found an exceptional amount of answers to this, but none that will show how they are inserted into the activity. My activity has a tabsadapter and viewpager (fragmentpageradapter). That's it. And I've set it to be styled as a…
Carl
  • 249
  • 2
  • 5
  • 13
0
votes
4 answers

How to define a line in centimeters in Android

I'm trying to define a line in Android which measure must be 10cm wide. I tried to put the width in mm and inches, but the results weren't satisfactory. Also, I tried to follow this link: draw square 3x3 cm in Android Desperately, i tried to measure…
user2318814
  • 15
  • 1
  • 4
0
votes
1 answer

GridView, Images from URL in 2 column

I am filling a GridView with pictures fetched from URL on a background Thread. So while the images are loading, the TextView below each image is already there, but the image has no width or height. The problem is that using DP is so confusing, I…
Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206
0
votes
2 answers

dip is not stretching properly according to screen resolutions in android phones

I have used dip(eg: width = 30dip, scroll bar till the middle of screen) , as parameter But in 3.5 inches phone it looks fine, in 5 inches screen phones its not at all coming till middle, here goes below middle.…
Naruto
  • 9,476
  • 37
  • 118
  • 201