screen

Creating an emulator for Galaxy S8? - Android Studio

浪子不回头ぞ 提交于 2019-12-12 07:43:52
问题 I create a new hardware profile in an attempt to make and emulator for the Galaxy S8/S8+. I set the screen size to 5.8/6.2 inches (depending on whether S8 or S8+, despite the fact this doesn't appear to affect emulator anyway), and the screen resolution to 1440 x 2960, like the device. The emulator appears nothing like it does on the real device. Testing my app on a real S8+ shows it to be laid out poorly, but on the emulator it appear to be relatively organised, and I noticed it uses the

How Android manages screen?

我的未来我决定 提交于 2019-12-12 07:03:41
问题 I'm just curious look at here Galaxy Note falls under normal size and XHDPI Sony Xperia S falls under normal size and XHDPI But how come in real device the layout look different on each device? How I provide layout for each Android device out there? 回答1: I don't think you can ever make a layout that will suit every Android device. I find the best results are by: (1) Using RelativeLayout s (2) Avoiding use of any hardcoded dimensions, instead using wrap_content and fill_parent where possible I

Android, How to fit message in Facebook dialog?

只谈情不闲聊 提交于 2019-12-12 06:36:49
问题 After two days of searching finally I could integrate Facebook SDK into my application. My problem is when I set bundle and show dialog interface, some parts of lines are out of screen. This is my code: private void postFacebookMessage() { Log.i(TAG, "Try to post message"); token = mFacebook.getAccessToken(); Log.i("token", "" + token); Bundle parameters = new Bundle(); parameters.putString("access_token", token); parameters.putString("message", "This is test message."); parameters.putString(

Android how to evaluate view size to keep same proportion in all devices

余生颓废 提交于 2019-12-12 06:10:15
问题 I'm searching for a way to keep view size proportioned on all devices. I experimented with many maths calculations (e.g. mixing screen size, density, percentage, etc.) but haven't found any solutions, just different results for each device tested. Let me present an example: Suppose I'm testing an app on a sw-360dp and eventually I find a size view that works. relativeLayoutParams.width = 150; relativeLayoutParams.height = 250; This has the effect of creating a view with size about 1/3 of

Layout issue in Android Studio for large and normal screens

谁都会走 提交于 2019-12-12 05:09:35
问题 In my res folder I have: activity_main.xml in the layout folder (so the default one), the same file in the layout-large folder and in the layout-normal folder. I set the layout I want in the preview of an Samsung Galaxy S5 (so a large screen) and then I run the AVD: here the layout is different. There's an image positioned differently. On the contrary this doesn't happen when I run the app on a normal screen. Here's the activity_main.xml file: <?xml version="1.0" encoding="utf-8"?>

Multiple screens for HTC Desire and HTC Sensation [closed]

為{幸葍}努か 提交于 2019-12-12 04:46:34
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . The thing I want to do is to have different layout for the Sensation and Desire models. I read things about programming for multiple screens and providing resources for different screen size and density, but this sensation resolutions drive me crazy . I have a layout that works

C# ImageSearch DLL

跟風遠走 提交于 2019-12-12 04:36:37
问题 So I have recently made a program which finds specific image on the screen and returns the location of it, I actually found this part of the code on stackoverflow, which is using ImageSearch.dll from AutoIT3. It works pretty well, however, there's one thing missing and I have no idea how to do it. I mean tolerance. This is the original definition of what it does: "; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF" Basically allows to find

Vibration even when the screen has timed out

蓝咒 提交于 2019-12-12 04:30:45
问题 I'm using the examples from this site: http://android.konreu.com/developer-how-to/vibration-examples-for-android-phone-development/ So, as you see, I'm using the Vibrator Service. The problem, which also is written on the site, is that the vibration don't work if the screen has timed out. Anyone has any ideas to fix this? It surely should work as the vibration works on phone calls, alarm etc. even though the screen is black. But maybe I have to wake up the phone before the vibration is called

How to make a capture screen app on Android

无人久伴 提交于 2019-12-12 04:24:31
问题 I want to make an app which can capture device screen without root as: https://play.google.com/store/apps/details?id=com.icecoldapps.screenshotultimate But I can't find the solution. Anyone help me? Thank you very much. 回答1: Programatically you can do so by executing the below command using adb: adb shell /system/bin/screencap -p /sdcard/img.png However to do the same from an application you can use the below method: Process sh = Runtime.getRuntime().exec("su", null,null); //getting superuser

Draw bitmap by canvas but it is slowly when make moving screen

对着背影说爱祢 提交于 2019-12-12 03:39:18
问题 I use canvas to draw bitmap to make moving screen and object. But it runs slowly. I used some way as move screen picture to res/drawable-xxhdpi as advise but it still be slow. public class MainActivity extends Activity { public static float xuser,yuser; public static float xcomp,ycomp; public static int vtx =100; public static int vty =0; public static int demsc=1; long startTime,updatedTime; private Handler customHandler = new Handler(); public static TextView txttime; public static String