I am using Afreechart to create charts for my android app. In emulator legend is visible but in android tablet legend is not showing up. Previously it was working properly but when i add some other activities to my app,its not working. am using afreechart-0.0.4.jar.my minSdkversion 3 and target is 15.
I found the solution for my question..
The thing that pointed me in the right direction was the fact that the graphs would behave perfectly on the emulator, independently from what version of Android the emulator was running. That made me think that maybe the hardware acceleration (which if I am not mistaken was introduced with HoneyComb) had something to do with this. A little more googling showed me that other graphics libraries had similar issues on ICS and JellyBean, so I tried switching off the hardware acceleration for the chart view:
chartView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Now the graphs and the legends show up just as expected on any device. Hope it helps someone....
Related
I'm currently working with Xamarin for developing an android app. The structure of the app is really simple yet but a big problem appeared concerning the rendering of my main page. First, it's important to know that I'm supposed to develop for target API 23 so Android 6.0.
And every time I test my application on my Android 6.0 device via USB-debugging the design is totally messed up with my only (!) button duplicated many times and the textViews mixed up over the screen (As shown in the picture link below).
Even though I am new to Xamarin and Android (and C#) I have my settings (as I think) in perfect order. The minimum API level is 21, the target SDK version 23 (Android 6.0), my device runs version 6.0.1, the target compiling framework in properties is set to 6.0, the manifest is set up as I mentioned before and even my "Designer" window with the layouts .axml is set to v23.
I really don't know what to try next, because I want to start coding further. Would be nice if sb could help me out with that.
I have already tested the code of the app on a different API level (26 I think) and it worked perfectly fine with my Galaxy S9 in Debugger mode. Everything looked like it was designed in first place.
I also tried different AppThemes in Visual Studio but not one of the 7-8 I tried worked in any way different except for the colors.
The android app does only switch when clicking the button, texthttps://imgur.com/i0xChVniew 2 into the current date and time. I'm really sure, that my code is not the problem.
Picture: How it should look (In Xamarin)
Picture: How it looks on the phone
I have an issue that is making me crazy.
I created an Android library for a Custom gauge view of a car applicaction.
On this gauge view there's a scale with values drawn with function Canvas.drawText().
Everything was working fine when running whis view on devices with API 19 and 22, up to when last week I updated Android Studio 2.2.
Since that time the values on the scale are not properly written if I run it on a device with API >19. If I run it on device with API =< 19 everything is fine.
This is the test project that can be cloned from Github:
https://github.com/dequadelisonz/CarDashDemo.git
This is what I should correctly see (on device with API <=19):
And this is what I see on device with API >19:
As you can see in the 2 gauges there are only few digits in one of the two. All the other texts seems to be disappeared.
Hope someone can do the trick to fix this thing....
Thanks!
Fixed thanks to this post
https://stackoverflow.com/a/14989037/746068
It seems there is a bug on Android APIs > 15 so that text is not properly drawn on canvas.
I'm using dygraphs to print a range selector diagramm in android. My problem is that the graph is going over the end of the diagramm div. This can be seen in the following picture.
On icanuse and different websites it says that android supported clip-path until 3.0. Since then clip-path isn't supported (I even tested it on LG G3 with android 5).
My question: Is there any workaround to prevent my graphs from clipping? Or do you have some ideas, which I could test?
Related Links:
https://code.google.com/p/dygraphs/issues/detail?id=200
http://dygraphs.com/tests/range-selector.html
https://github.com/danvk/dygraphs/commit/971870e5232350812bf91dc7b555332a8993efda
I have a problem with overlay of x labels in achartengine TimeChart with time format => chart.setDateFormat("kk:mm:ss").
If I test in in Android 4.0.4 (Samsung galaxy tab) the x labels are visible in a way that they don't overlay each other.
But the problem is in Android 4.3 (HTC One - Full HD), where it seems that this filtering is not working, so there are too much of labels and they overlay each other and user can not read anything. It seems that it happens also in Y axis where the values are doubles.
OK.
So I found the solution. The problem was, that I'm using achartengine as an library project and I was building achartengine project in API 10, and my app was in API 14.
Because of that I had some strange behavior. When I changed achartengine project library to be build in API 14, the problem disappeared.
:)
I'm currently developing an application with which a schedule can be retrieved and viewed. To display the schedule I used the TimeRulerView (and BlocksLayout and BlockView) java source files from the Google IO 2011 app because I liked the look and feel. Source code can be found here: https://github.com/underhilllabs/iosched2011 . (Google replaced there one with the code of IO2012).
Since my Galaxy Nexus updated tot Jelly Bean (4.1.1) yesterday the TimeRulerView (and/or one of the others) doesn't get shown anymore.
The weird thing is that they are actually still there, but there not visible. I can see a scrollbar of the length the timeruler normally has. Also when I normally click on an block in the view I get a little pop-up, and this still happens when not seeing the timeruler or a block.
I tested the original IO2011 app on my JB GN but nothing is visible there either, so the problem lies within (one of) the view(s) or the way JellyBean is rendering the view(s) (project butter maybe?).
See here ( https://dl.dropbox.com/u/7102660/TimeRulerView_JellyBean_problem.zip ) for screenshots on ICS (app working), JB (app not working) and the GoogleIO2011 app.
Could this be something to do with Hardware acceleration? I just recently ran into an issue on couple phones with ICS, but not all phones/devices were affected. Adding the hardwareAccelerated tag to my manifest didn't fix the issue either, and I had to define it on specific views that I did not want to be hardware accelerate. My solution used android:layerType="software" in my xml layouts and setLayerType(LAYER_TYPE_SOFTWARE, null) in the java code.
EDIT: Testing this more, it didn't fix my issue using setLayerType on Jelly Bean. Setting the layer type to software on ICS did fix my issue. The only way I could make the views show up was setting the whole application or specific activity to android:hardwareAccelerated="false".
Thanks to Chris answer I played around with hardware acceleration settings. I use the iosched2011 code as well and only had to remove the line android:layerType="software" from my BlocksLayout View inside the block_content.xml file .