Android :: Android Brightness Change / Smooth Transition
Jul 16, 2009
I am trying to resolve following task: smooth change of brightness from 100% to 0%, but can't gain effect of smoothness. Want to emphasize that I am using following approach of brightness
change. The recommended one.
WindowManager.LayoutParams lp = window.getAttributes();
lp.screenBrightness = floatPercent;
window.setAttributes(lp);
Well, it obviously works, but not smooth. I will describe logic: I have a thread that changes brightness:
while (isRunning()) {
Thread.sleep(sleepTime);
spentTime+=sleepTime;
view.post(new Runnable() {
public void run() {
changeBrightness();
} } );
}
I have duration of brightness change, for example 10 seconds. I calculate next value of floatPercent (see code snippet above) the way, sleepTime should always be less than 50ms.
So looks like it had to be smooth. But I always get not smooth transition. It relates specially the range of 0% - 5% of brightness. Smoothness is completely lost on this brightness range.
View 5 Replies
Apr 16, 2009
I am using opengl es for images to translate from one position to other. But, the transition is not going in a smoother manner they are just jumping from one position to other. How can I get smooth transition of images? Rightnow I am using glRotatef() and gltranslatef(). Do I need to add anything extra? Please do respond.
View 4 Replies
View Related
Oct 27, 2010
I am working on an porting an application supporting segmented video streaming to Android. For those who are not familiar with segmented streaming, it is when a complete video is divided into multiple segments. Each segment can then, for example, be encoded at different qualities to support different clients.
Anyway, my problem is that I am not able to get a smooth transition between segments. Currently, the only way I have gotten segmented streaming working, is to write the segments into independent, temporary files, and then load each file into the MediaPlayer once the previous has finished. This causes an interruption in playback between each segment, probably due to the I/O involved.
I have looked around for different solutions, among others, playlists and storing the videos directly in memory. However, none seem to work or be supported by Android. Also, I tried creating two MediaPlayer- objects and do something similar to double-buffering by preparing the next segment well ahead of the previous, but it only made the application unstable.
My question is therefore: Does anyone have any hints, tips or examples for how to do smooth transition between video segments? The segments I am working with are independent, so there is no dependency and they can be viewed as X number of independent video files.
View 6 Replies
View Related
Sep 15, 2010
I've been plugging my phone into my car audio and running my slingplayer while on my long morning commute, in which i travel through a few areas that are out of 4G coverage. When this happens, the feed fails and doesnt start back up till i reconnect the slingplayer. What I've had to do basically is turn off 4G completely so I stay on 3G all the way. Anyone notice this on other applications on EVO (or the Epic, I guess)? Anyone having issues with pandora, hulu, subsonic, youtube, etc? I remember back before the release of evo at the big new york event they said transition between 4G and 3G would be smooth but my personal experience has shown it not to be while streaming.
View 7 Replies
View Related
Nov 15, 2012
I have a htc sensation xl. My brightness control stopped working and I now I can't change the brightness anymore. It doesn't matter if I set to 30% or 100%, the brightness stays the same.I can only adjust the brightness from 0 to 25%. I already did and wipe and stiched a phone.
View 3 Replies
View Related
Mar 6, 2013
Is there a way to change the transition animations in 4.2? Like fly in, flip, bounce, etc.
View 1 Replies
View Related
Aug 18, 2010
I am starting an activity and would rather have a alpha fade-in for startActivity(), and a fade-out for the finish(). How can I go about this in the Android SDK?
View 2 Replies
View Related
Oct 28, 2010
I'm trying to control to turn screen off/on. I'm using device HTC G1 (1.6). To turn off screen I write:
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 0f;
getWindow().setAttributes(lp);
But if I want to turn on screen:
lp.screenBrightness = 1f;
getWindow().setAttributes(lp);
Screen not turn on.
if lp.screenBrightness = 0.02f;
screen change bright, but not turn off.
Which right way to control by screen?
View 2 Replies
View Related
Jul 15, 2009
I am trying to resolve following task: smooth change of brightness from 100% to 0%, but can't gain effect of smoothness. Want to emphasize that I am using following approach of brightness change. The recommended one.
WindowManager.LayoutParams lp = window.getAttributes();
lp.screenBrightness = floatPercent;
// 0 - 1 window.setAttributes(lp);
Well, it obviously works, but not smooth. I will describe logic. I have a thread that changes brightness:
while (isRunning()) { Thread.sleep(sleepTime);
spentTime+=sleepTime;
view.post(new Runnable() {
public void run() {
changeBrightness();
} } );
}
We have duration of brightness change, for example 10 seconds. I calculate next value of floatPercent (see code snippet above) the way, sleepTime should always be less than 50ms. So looks like it had to be smooth. But I always get not smooth transition. It relates specially the range of 0% - 5% of brightness. Smoothness is completely lost on this brightness range. What can you propose?
View 3 Replies
View Related
Oct 26, 2012
Any app that will automatically change the screen brightness based on a defined battery level. Preferably with the option to define how much the screen is dimmed as well.
View 1 Replies
View Related
Sep 23, 2013
my phone is Samsung Galaxy Mini which is a ldpi device which now runs on an ICS rom. I am trying to change the color for the brightness sliders and volume sliders. Which .xml need to be edited to change the colour..
I decompiled framework-res.apk and changed hex color values under @id/ progress and @id/secondary progress in "progress_horizontal.xml", also changed colors of few pngs in drawable-mdpi in framework,now the progress seek bar has changed the color,but brightness slider color remains the same.
I then decompiled systemui.apk and changed the hex color values under @id/progress in "adi_seekbar.xml",but nothing got changed..
Which .xml is associated with the seek bar for brightness and volume slider? Or should i deal with smali files to change the color of brighntness slider and volume slider..
View 9 Replies
View Related
Jul 21, 2010
If you swipe your finger on the notification bar (with the panel still up), you can change your brightness, anywhere that bar is present! Useful when auto brightness isnt on and you need a quick brightness change. I'm not sure if this is a touchwiz feature or an android feature.
View 14 Replies
View Related
Dec 10, 2009
Anyone know a way (or an app) that will change the brightness depending on whether the phone is plugged in or not. I would like it to on full brightness all the time when the USB is plugged in, but use auto-brightness when running on battery.
View 1 Replies
View Related
Sep 17, 2010
I am working on a application, in which I want to show Image gallery containing full screen images. I have put the gallery in the application successfully. But I am failing to apply some properties to the gallery as per the app design demands. I am using android.widget.Gallery library of android. The things I am failing to do are:
1) I wanna scroll the gallery images one at a time, as now its getting scrolled more than one images in one scroll.
2) And on scrolling the gallery, the images coming next from left/ right should move smothly into the screen and should stop at the screen edges. It should not scroll beyong that in one scroll.
View 2 Replies
View Related
Nov 24, 2010
Probably this question is answered. If it is, could you point me in the right direction then.
I would like to add the smooth scrolling functionality into my application.
i.e. I have a huge text and I want to scroll it automatically (like in book readers)
Could anyone offer any examples of smooth scrolling?
View 1 Replies
View Related
Jul 26, 2010
In my app i have gradient as drawable which i am using as background and i want it to make it look as smooth as possible. After googling and trying by myself i came up with the following. On nexus one if you call only setDither(true) your gradient is still banding so you have to set PixelFormat like this Window.setFormat(PixelFormat.RGBA_8888). But on the other side G1 does not support RGBA_8888 so calling it make the gradient even uglier than before so Window.setFormat(PixelFormat.RGBA_8888) will not work well on devices that don't support it.What is the correct way smooth my gradient on all devices on which my app will run.
View 1 Replies
View Related
Apr 5, 2010
I am using "ViewFlipper" for my application. This ViewFlipper includes 5 layouts. I am trying make it that can be changed from current layout to any layout. In other words, it can be changed Layout#1 -> Layout#5 or Layout#4 -> Layout#1 ..etc. How to make it? I used showNext() and showPrevious(). It is not better idea for my case. Can I use ViewSwither instead of this case?
View 1 Replies
View Related
Sep 14, 2010
im currently playing around with a Game that architecture is basically like the example 2d Games like JetBoy / LunarLander and so on. But as things now running (and animating continuously) they have kind of "hiccups" when the GC is running. I have done all i can to allocate as much Objects in front. There is nearly nothing that is created "new" besindes some Strings that are used to set the Score and so on. (TextView doesn't take int's =( - So do you have similar Problems that the GC is "lagging" your 2s game ? any solutions ?
View 12 Replies
View Related
Feb 15, 2009
I am showing a RSS feed in my application using Webview as ListItem and it works great except that it is very sluggish at times. Since I don't know the size of the content then I can't set the height of each Webview and therefore I have the following code (this is the code for a single ListItem)...
But the "wrap_content" causes the Webview to readjust size when scrolling. The scrollbar-indicator of the listview also has problems knowing the size of the complete list so it changes size when scrolling. All this causes a very "jerky" experience when scrolling.
Is there any better way of doing this?
View 2 Replies
View Related
Jun 23, 2009
Can you advise me how to apply view transition animation. ex: when i click on an list item my contentview changers. I want to apply a transition animation in that.
View 5 Replies
View Related
Nov 17, 2010
I would like the ViewFlipper animation to look (almost) the same as the native Activity show/disappear. I currently have fly-out-to-left and fly-in-from-right animations when user clicks Next, but the animation is not smooth..........
View 2 Replies
View Related
Aug 11, 2009
i am trying to have a nextpage transition like book page. at the moment i just change the image on imageview and move from left to right but this doesn't look good. i believe book page transition is available in iphone but i doesn't seem to have any single example for android.
View 4 Replies
View Related
Aug 17, 2010
In my android app, I'm making a method that pop all activities and bring up the first activity.
Intent intent = new Intent(this, MMConnection.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
this.startActivity(intent);
As I noticed that the transition was still a left to right animation, does someone know if there is a way to change system animation when starting an activity? Actually, I'd ideally like to have a right to left transition (like when the return button is tapped)
View 1 Replies
View Related
Dec 21, 2009
I'm sure a lot of us using the Droid are coming from a BlackBerry. Well here is what I miss: Being able to skip tracks by just holding down the +/- Volume for 2 Seconds. (Instead you have unlock the screen and hope you're still in the app for your media player.) Flip to your next picture with a flick. This was fixed with "Multi-Touch Gallery for Droid" A facebook app that lets you check Live Feed and your Inbox.
^Same thing for MySpace Custom LED color for different Alerts.
View 3 Replies
View Related
Feb 1, 2010
I am drawing a pretty simple scene, with one large texture the about size of the screen (two triangles). I notice that the frame-rate is irregular: in most of cases, a frame finishes in 17 ms. However, in about 1 of 10 times, the frame finishes in 33ms.
My guess is probably some background services need to run. However, the Linux scheduler is biased towards my FG app, so the BG services are usually starved, until they can't take it anymore and they grab the CPU from my app ....
I am seeing stuttering in the animation. Is this due to the irregular frame rate? Should I delay each frame so that all frames are rendered with 33ms frame time? If so, what's the best technique of achieving this?
Is there an API that I can call to guarantee CPU resources for the render thread .... I really hope Android runs on some sort of real time kernel ...
View 7 Replies
View Related
Jul 5, 2010
On iPhone, Mobile Safari is WebKit based and supports hardware-accelerated -webkit-transform CSS properties. To be specific, I use the translate3d() transform.
What alternative is there for the Android browser? I need it to work on Android 1.5.
View 1 Replies
View Related
Jan 31, 2010
Following this : http://stackoverflow.com/questions/2125354/best-approach-for-oldschool-2d-zelda-like-game
I got a simple 2D tiles generator working, im reading an int map[100][100] filled with either 1's or 0's and draw tiles according to their tile id, 0 is water, 1 grass.
Im using some basic Numpad control handler, using a camIncr (32.0f), i set the camera position according to the movement :
CODE:.......
In my draw loop, im just drawing enough tiles to fit on my screen, and track the top left tile using cameraOffsetX and cameraOffsetY (its the camera position / tile size )
Im using a GLU.gluOrtho2D for my projection.
Here is the draw loop inside my custom renderer :
CODE:.............
my tiledBackground draw function :
CODE:..............
The waterTile and grassTile .draw function draw a 32x32 textured tile, might post the code if relevant.
Everything is fine, i can move using numpad arrows, and my map 'moves' with me, since im only drawing what i can see, its fast (see http://stackoverflow.com/questions/2129125/android-opengl-es-simple-tile-generator-performance-problem where Aleks pointed me to a simple 'culling' idea)
I would like my engine to 'smooth scroll' now. I've tried tweaking the camIncr variable, the GLU.gluOrtho2D etc, nothing worked.
View 2 Replies
View Related
Nov 23, 2010
I would like to add the smooth scrolling functionality into my application. i.e. I have a huge text and I want to scroll it automatically (like in book readers) Could anyone offer any examples of smooth scrolling?
View 2 Replies
View Related
Aug 26, 2009
I am creating an app that show some histograms off your traveling speed in different time periods (histogram for the last minute, histogram for the last 2 minutes etc.) I would like to have an animation, and have discovered that drawing everything takes around 300-400ms. Which is to long for making my animation smooth, the animation itself is quite simple (2 lines and 2 dots). What I draw every frame right now is 20 antialised strings, size 14, in average ~5chars 8 of these strings will change every second. 1 of the string will change with the animation (this will become 5 strings if there is time).
The main part of the screen, the one showing the histogram data, consist of a lots of squares which needs to be updated every second. (450 squares). The presentation is split into 5 frames in the same view (has to be same view as arrows in one frame might point into another frame). Invalidating only a part off the screen makes almost no difference (it does becomes a bit faster, but i still execute all my drawing stuff). I have tried to add a flag whether or not the main part is dirty, but if I don't draw it, it is cleared. I might be missing something here. One possibility could be to render all the mostly static stuff to a bitmap, and then simply draw the bitmap. That would mean 10 strings only had to rendered on orientation change.
I think it would make sense since the slowest routine is the one drawing all the text. (the following is a typical timing for the drawing routines, accumulated).
V/HMMULTIBAR( 352): 0 - Drawing time: 0 ms V/HMMULTIBAR( 352): 1 - Drawing time: 53 ms V/HMMULTIBAR( 352): 2 - Drawing time: 62 ms V/HMMULTIBAR( 352): 3 - Drawing time: 85 ms V/HMMULTIBAR( 352): 4 - Drawing time: 280 ms V/HMMULTIBAR( 352): 5 - Drawing time: 303 ms
I would really appreciate comments about whether or not offscreen rendering is the way to go, or if there is a simpler way.
View 6 Replies
View Related
Dec 28, 2009
I'm drawing a rect to a surfaceview. Nothing special, just a test like this, in the surfaceview-extended class:
private int mPosX = 0; private Paint mPaint = new Paint(); Code...
the rect just bounces around the screen. I'm watching DDMS, I still see the garbage collector being called, even with this simple draw loop. There is no other application code being executed.
I'm wondering if it's realistic to expect the gc to not be called at all if we take care to not allocate any objects during our draw loops. I'm trying to extend this example to do some smooth animations, but every once in awhile the gc is called and you can see the drawing stutter. Although none of my application code is allocating any new objects, I don't know what the underlying API is doing inside surfaceview etc, and I doubt we can control that. Just wondering if this is not possible, I'd prefer to abandon this game idea up-front if we can't guarantee smooth animation.
View 5 Replies
View Related