[Q] How to change orientation of another application from inside my application ? - General Questions and Answers

Hi ,
I am creating an application which will change orientation of some other already installed application , Reading the orientation of other application installed was simple through ApplicationInfo object but noway to change it.
After some R&D I have come to notice similar types of app's (which change orientation) also run Service , that means' they make orientation change on fly but I don't know how exactly they do it ?
Regards
New Android Developer

Related

[Q] Intercepting the accelerometer ?

Hello,
Another simple question:
I am developing a game on Android. Whenever the device (equipped with a accelerometer) turns sideways, the app RESTART on a rescale landscape display.
I don't really mind the graphics rescaling (my work, to accommodate different screen size..), but I mind the whole state of the game being reset!
So, my question is:
How can you intercept the accelerometer movement so that the app will NOT reset the display, landscape/Portrait, and hence the app ?
I've tried installing a SensorEventListener in the Activity class, and I was able to read the accelerometer, but not to intercept/avoid the resetting of the graphics sideways.
I've seen code that seems to work as I want to in an OpenGL app with overriding "onSurfaceChange(GL10 gl, int width, int height)"
But my game isn't OpenGL.
Is there an equivalent on "Activity" ??
Thanks!
Found my answer:
android:screenOrientation="portrait" in manifest.xml

[Q] Tilt sensor is off for some apps, possible fix?

Before my Asus tf700 Infinity, I owned a Samsung Galaxy Tab. I purchased some programs and games for it, and all was well until it was stolen. The problem? Now I've downloaded and used those same apps on my tf700 Infinity, and the orientation is off by ninety degrees on quite a few. It has to do with Android's API and Honeycomb, and how the default base orientation is set in the framework policy. Before tablets, the default orientation for the Android API was portrait, but tablets made landscape defaults a possible better default. Apps not written to accommodate this would have the sensors read 90 degrees skewed for landscape default devices (like my tf700), because the sensor data is being read from landscape (regardless of orientation), but interpreted as portrait by the app. Even though my Galaxy Tab was a tablet, it's default orientation was portrait, so there was no 90 degre skew. I have read enough to know that it's possible to change the Android system default value, but it has to be changed in the framework . . . No easy task, especially if the rom is ODEXed.
So . . . anyone have any advice or fix so my paid apps aren't wasted money? I don't think emailing every single developer is the key, when I could modify a single system value to fix the problem for all apps. Thanks in advance, any help is appreciated.
Doesnt ever gyro-based app/game have a recalibration setting? Have you tried that?
Send From My Samsung Galaxy S3 Using Tapatalk 2
GrayHat137 said:
So . . . anyone have any advice or fix so my paid apps aren't wasted money?
Click to expand...
Click to collapse
You could try Ultimate Rotation Control. It can have an individual setting for each application (Forced Portrait/Forced Landscape/Forced Auto).
ShadowLea said:
Doesnt ever gyro-based app/game have a recalibration setting? Have you tried that?
Send From My Samsung Galaxy S3 Using Tapatalk 2
Click to expand...
Click to collapse
The problem is that the data the app is getting is from the sensors is rotated 90 degrees. For example, if the app assumes the tilt data it is getting is from the left and right: tilt left, go left. On my tablet, it's default boot state is landscape, so if the app is asking for the sensor info the wrong way (a deprecated way - from before the Honeycomb API), it's getting the tilt axis from the top and bottom, so: tilt up, go left. I can calibrate, but I still have to tilt up to go left.
Sounds like badly programmed apps to me. Have you tried asking the devs to update based on the correct APIs?
HeartWare42 said:
You could try Ultimate Rotation Control[/URL]. It can have an individual setting for each application (Forced Portrait/Forced Landscape/Forced Auto).
Click to expand...
Click to collapse
I had hoped it would override the default framework, but apps were still polling the sensors wrong no matter which orientation they were displayed in. The sensor data was rotating the same amount as the app, but the original sensor data was still originally off by 90%.
Thanks for the tip; Ultimate Rotation Control is a good app that solved another issue I had, just not this one.
sbdags said:
Sounds like badly programmed apps to me. Have you tried asking the devs to update based on the correct APIs?
Click to expand...
Click to collapse
Yes, that's the consensus. Some I've asked, others are no longer in active development (nostalgia for holding onto these apps). I stumbled upon a web hit while googling for answers, the solution was about changing a simple setting in the android framework, but I'm a not experienced with ADB, and things like ODEXing and DeODEXing are nerve-wracking while I learn and experiment.
Also, thanks for coming sbdags. Running Xenogenesis since late April, fantastic job! :good:
GrayHat137 said:
Yes, that's the consensus. Some I've asked, others are no longer in active development (nostalgia for holding onto these apps). I stumbled upon a web hit while googling for answers, the solution was about changing a simple setting in the android framework, but I'm a not experienced with ADB, and things like ODEXing and DeODEXing are nerve-wracking while I learn and experiment.
Also, thanks for coming sbdags. Running Xenogenesis since late April, fantastic job! :good:
Click to expand...
Click to collapse
Which part of the framework do you need to change?
sbdags said:
Which part of the framework do you need to change?
Click to expand...
Click to collapse
Navigate to the androidpolicy\com\android\internal\policy\impl folder and open PhoneWindowManager.smali in your favorite text editor (Notepad++ is my favorite)
Search for the method "rotationfororientation"
(Picture of code here)
Make note of the variables (v#) for portrait and landscape (in my case portrait is v5)
Scroll to the end of the method and you should find something like:
"move v2, v5" (make sure it's the last move command before the end of the method)
Change the second variable (in this case v5) to whatever orientation you wish to be default. In my case I have set portrait as the default orientation.
Click to expand...
Click to collapse
There are other steps, but this is the only variable changed. I can't post links yet, and I didn't want to copy all of the text there, but that's it. The attached picture is the picture of the code.
Eureka!
GrayHat137 said:
There are other steps, but this is the only variable changed. I can't post links yet, and I didn't want to copy all of the text there, but that's it. The attached picture is the picture of the code.
Click to expand...
Click to collapse
Dear friends,
As I was also facing the same problem in my Ubislate 7C+(EDGE) tab by DATAWIND. While reading your post an idea struck to my mind. With the help of Root Browser app I navigated to /system/build.prop, opened it in text editor and in "ADDITIONAL_BUILD_PROPERTIES" changed the value of "ro.sf.hwrotation=270" 270 to 180 saved it and rebooted the tablet. Yes! the problem was solved but it created a new problem that the orientation of animation while boot and camera orientation has changed now but in order to rectify it I pulled bootanimation.zip to my computer and after unzipping it changed the orientation of animation files from portrait to landscape. Changed the orientation in 'desc.txt' from 480 800 to 800 400 and zipped both without any compression. Pushed it back to /system/media and changed the permission, user,group to original one with the help of root browser. Then for camera orientation with the help of root browser I navigated to /system/etc/camera.cfg opened it in RB text editor and changed camera orientation from 90 to 0, saved it and rebooted my tablet and now all the games using gsensor tilt are working fine.
Thanks,:good:
rotation gyro off
I had the same problemen, i resolved it by going to setting, location and then status (only GPS) then i started GPS tools , just waited a min or so . now everthing is oké again.
I hope thuis helps you

app shortcut with specific settings

Hi there
i am wondering if there is any way possible to create shortcut of an app, that will trigger the app with specific settings ...
An example: i would like to create different shortcuts for the Camera - one that will start the camera with resolution 640x480px, an other one in full definition, and a third one that will start the camera in video mode ...
If this is possible (not only for camera), it could be very helpful, as sometimes, for example of camera, while one takes out the phone, launches the camera, sets the settings needed - the situation he wanted to shot is gone ...
Any idea?

Motorola Motoactv Calculator app,resizing screen & scroll question

I have had my Motoactv watch rooted for quite some time now and its been working flawlessly, however, the two problems I cant seem to troubleshoot are
1.Where for the love of god do I find a perfect calculator app that fits the screen perfectly. Every app ive downloaded the screen shrinks to the point where several buttons get mashed together.
2. On a similar subject, I have been trying to use the mouse & keyboard remote app to control my pc but when attempting to add a new server on the watch I get as far as adding the name & ip numbers but I cant save it due to the screen being too small for the save button to be shown.
Is there any way to resize the screen on certain apps or perhaps have a scroll option of some sort that will allow me to view these apps in full size somehow?
dorkgeniuz21 said:
I have had my Motoactv watch rooted for quite some time now and its been working flawlessly, however, the two problems I cant seem to troubleshoot are
1.Where for the love of god do I find a perfect calculator app that fits the screen perfectly. Every app ive downloaded the screen shrinks to the point where several buttons get mashed together.
2. On a similar subject, I have been trying to use the mouse & keyboard remote app to control my pc but when attempting to add a new server on the watch I get as far as adding the name & ip numbers but I cant save it due to the screen being too small for the save button to be shown.
Is there any way to resize the screen on certain apps or perhaps have a scroll option of some sort that will allow me to view these apps in full size somehow?
Click to expand...
Click to collapse
1. There is a good calculator app included with DPRom. I can pull the apk and post later today/tonight if you need it
2. Download the Xposed framework installer and App settings module found here: http://forum.xda-developers.com/showthread.php?t=2490548
This will allow per-app DPI settings. It's better than changing the DPI globally as that can adversely affect other apps. In order to install the Xposed framework and modules, you need to make sure the apks are moved/installed to phone storage first before running them or the changed will not go into effect.

Fake rotation app for android

Hi everyone. The present question is originated because I have a 10" android tablet, which I use all the time on landscape mode, by using a forced rotation app. But I've could see that some apps aren't displayed on a "nice way" (mainly, their GUI is too big, and overflow the screen). I must supose this is because app developers, mainly focus their apps' gui to be used on portrait mode (and maybe that's because even on landscape mode, some apps try to rotate to portrait mode).
Ok so; First, I know that does exist apps which force screen mode (landscape, portrait, reverse landscape, and so on). Also I know that an "easy" way you can get a "workable" gui on those apps, is reduce android's DPIs (i have root access), but if I do that, I can "enhance" them, but I mess the rest of remaining "good" apps. And because of that, I know that does exist an Xposed (lsposed) addon, that allows to change dpi selectively, per app; but that addon almost hardbricked my tablet (hehe).
So finally I wondered myself something, and I want to ask you this: ¿Does exist any app that performs, or allow a "fake" rotation? I mean, for instance my case; I need that if my tablet is on landscape mode, and i try to open an app which doesn't "like" landscape mode and if forced to it, is poorly displayed; this app would make it display on landscape mode, as is if it was on portrait mode.
I don't know if i made explain right, but I know i'm not talking about something new, because I've seen before that behavior precisely on android emulators, so I know it's possible, but ¿Is there any android app that could do that?

Categories

Resources