Best way to create a trend/graph in my application - android

I have currently some values in an array that I would like to display in a trend / graph ( don't know the appropriate english word)
I have been looking in Android source code to find the Gingerbread battery graph (https://android.googlesource.com/platform/packages/apps/Settings/+/gingerbread-release/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
)
That solution seem to be a little bit overcomplicated and too much for a simple and nice graph.
Can someone point me a tutorial / code sample?

Try AChartEngine, it's really easy to understand and set up. Comes with plenty of examples too. http://www.achartengine.org/

Related

How to use mediapipe graphs like the mediapipe API-s

I'm struggling to understand how am I meant to interact with the "graph" and "calculator" stuff from the mediapipe library. More specifically, I'd like to write some Android code that uses landmarks from the holistic (pose + hands in my case) solution, with the final goal of writing a flutter application that compiles both for Android and iOS.
I've managed to build a few of the sample apps (thanks to docker), and I think I roughly understand what the graphs do. However, I don't understand how to interact with them from within the code. The Hello World! for Android tutorial doesn't really explain this. There are examples that include this type of behaviour (e.g. here), but I don't really know where is all the required information coming from (e.g. how would I find out the right functions and string constants to get holistic landmarks?)
For example, in Python I could get data via something like holistic.process(image).pose_landmarks, and then compute e.g. position or angle of hips. And as far as I can see there are some similar Android API-s available, although not for all solutions - including holistic. So what if I don't want to wait for the API-s development, and want to use the graphs instead? That part is not so clear.
As a bonus, please do feel free to drop any links which further explain/document the "graph" and "calculator" stuff I've mentioned earlier, as I've not used anything like this before and find it a little difficult to google.
Thanks.
I've realised there are docs available: https://google.github.io/mediapipe/framework_concepts/framework_concepts.html
Not sure how I've missed this...

Best practice to convert screen design to XML in Android

I'll start with the fact that I'm quite new to Android
app development and I came across a real App screen, that I thought will be a good practice to convert to XML.
Although I successfully copied some parts of it, I believe I lack a little bit of knowledge to achieve that goal. So I hope to learn from your answers.
Please keep the answer as clean as possible since I wish to learn forward from it.
Thanks in advance!
NOTE:
1) The icons on the gray line are clickable.
2) the X on the light blue line is clickable and deletes the line.
So, I create for you quick demo app(it is not as good as for commerce practice). How it looks and works from inside you may see here in GitHub repo. Hope I help you!
Things you try to avoid:
hardcoded text & colors in XML
not consistent id-naming
none-dimensional code *, for example like this - android:textSize="16sp"
* - I mean use dimens.xml, for instance - android:textSize="#dimen/default_input_text_size"
I will recommend you read a great book:
Clean Code - Robert Martin
Also, I support #FrancislainyCampos post. You should try to read also about design and develop tools to think and do more consistently with Google recommendations.
Although I've heard of some new tools that proclaim to be able to automate the task of converting design screens to xml, I don't think that's wide spread around the Android community yet. I think the best tip for you here is just to actually type each element on the screen not converting it but making the layout happen. There's a few tutorials on how to use Constrainst Layout to achieve that on Youtube. I'd also suggest this course here on Udacity that explains the step by step on creating your first screens for Android.
Hope that helps.

How to draw Line chart in monoandroid(xamarin) with shinobi chart library

I am using "shinobicontrols" (link given bellow) for my mono android application(xamarin).so, now i want to draw line chart for two data field one for "ask" price and one for "bid" price. so, any one can help me?
thanks in advance ....
http://www.shinobicontrols.com/android/shinobicharts/price-plans
The best place to ask for help relating to Shinobi Charts is their forums, there you will get help from people who are familiar with the libraries and the devs themselves.
It seems like you are just getting started, so the best place to begin would be the user guide, available here:
http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.3.5/Premium/Normal/user-guide/index.html
This will take you through the steps needed to create and render a chart, there are also more detailed API documentation for the Xamarin bindings, for example for a Line Series (which is what it sounds like you are wanting to use):
http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.3.5/Premium/MonoTouch/Com.ShinobiControls.Charts/LineSeries.html
Finally if you are still having problems feel free to post on the forums:
http://www.shinobicontrols.com/forum/shinobicontrols
Hope this helps, if you are still struggling just let us know what we can do to help.
Craig.
(Full disclosure: I work for ShinobiControls)

Android user interface elements usage

I did search the internet to find an answer to my questions but there are no websites that did help me, so I hope someone can! Thank you in advance and have a nice day :-)
So these days I've been busy to get more into the Android Design guidelines and to learn more about it and how to implement it in my future applications. This is the main website I use to see what the guidelines are: http://developer.android.com/design/index.html. Great website but there are a few small things I just can't find in the dev guide or somewhere else. I just don't know how to implement some (simple) UI elements.
Can someone provide me code snippets of the following questions? (I want to know how to do it as simple as possible, how Google ment it!) It can help other (starting) developers too!
My main question is, are there special elements to achieve these things? As they are the key element in Android 4.0 it should have this things as some standard right?
1) Android 4.0 is using titles with dividers a lot in there new theme and it's looking great. But I can't find how to do implement this element simple like it should. What I want to know is how to make this blue title text with the grey looking divider underneath it look at this picture:
2) How to make section dividers in general? Like this image:
3) How to make a list with section dividers and give a list-item a 2-line explanation under it's name like this:
I did search the internet to find an answer to my questions but there are no websites that did help me, so I hope someone can! Thank you in advance and have a nice day :-)
In most cases how you are going to have to do it is create a custom layout. I tried recreating the look of the people application this way. for the most part the look you are going for is similar to the PreferenceActivityview. That gives you the look of the last image and probably how it was done in the People application with some extra programming. I just found it easier to create my own layout though instead of trying to mess around with that.
To my knowledge there is nothing in the api to create what you are looking to do easily and custom layout are going to be the way to go.
the custom dialog layout like you show in the beginning is very simple to do so if you dont know how to do manipulate layouts I would start there. look up the android color swatches to get the color of that blue
Edit
another thing you could do is look through the People source code and see how they did it but it will probably be more of a pain than what its worth when you can just do a layout

Graphics in Android?

I'm trying to make a simple graphic in my Android app. I don't know how to start. I searched for some examples,but I found them to difficult for me.
I have 2 arrays with values and I want to represent them on a graphic, on Ox one array, and on Oy the other one.
Can anyone give me some simple example ? Please..
I believe you mean making "charts" ("graphics is too broad a term).
Check this questions for chart libraries to do it: Is there a good charting library for Android?

Categories

Resources