Android equivalent to Java's Swing JSpinner - android

I want to use a control similar to Swing JSpinner in an Android application. I know that Android has a widget called Spinner, but it's more like a combo box than a JSpinner. I've noticed that DatePicker and TimePicker widgets are using components that are just like JSpinner. The only problem is that I don't really want Date or Time. I just want to get some integer, say from 1 to 50, that user chooses. Is this possible? I've searched Android API reference in and out, but I couldn't find any clue on how to do this. Any help or hint would be much appreciated.
Thanks,
Tomislav

Well, the functionality for the TimePicker is provided by a hidden internal class named NumberPicker, which would probably be exactly what you wanted if only the folks at Google had made it available.
You might want to go to the android source code and lookup the source to android.widget.NumberPicker in the frameworks/base repository. (The repository treats it as if it were a publicly available class, though I see no sign of it in the released dev jars.)

I stole the spinner from Astrid, which stole it from Android's source.
Take a gander here:
http://github.com/ralphleon/TeaTimer/tree/master/src/goo/TeaTimer/widget/
Though my app is GPL, the number picker code is under the permissive Apache license!

Related

Time Range Picker for Android?

Does anyone know anything about useful time range picker libraries that are open source? For example, the app Twilight uses some custom slider view for picking time ranges that I find very appealing (see bottom):
Is this open-source or are there similarly functional pickers? I could not find anything useful in the docs or on Android Arsenal.
Alternatively, I might build it from scratch. I was just wondering if there is not anything around yet.
You can try this slider from Material Design library and implements for youself:
https://material.io/develop/android/components/sliders
ps. check the section: "Setting a LabelFormatter"
An open source solution using a pop-up-dialog : TimeRangePicker

How to create an Auto Clicker app which can click on other apps?

I have seen so many apps that provide auto tapping feature. But they don't provide some specific customization so I decided to create a one. I have seen many tutorials that offers auto tapping, but they are supposed to be used in the same app. But I want to create an auto tapping app that can click on other app's View. I am an intermediate java developer but new to Android studio, so I don't know much about Android APIs. Is there any class or package which can provide this feature. For more clearance, I want to do auto tap, when the color at the specific location on screen, (213, 120) for instance, becomes green.
Thanks in advance!
I am not an expert on the subject, I have experience as a BackEnd developer, I am new to the Android world, just like you I am interested in building an app to automate some farming mechanics in Android games with specific behaviors, so I investigated on the subject and the solution you are looking for is the AccessibilityService API, from Android 8.0 (API level 26) it includes several functionalities to make touches without the need for Root, I leave you links with examples of some open source repos that can guide you.
https://developer.android.com/guide/topics/ui/accessibility/service#continued-gestures (Doc)
https://github.com/nestorm001/AutoClicker (Old and abandoned project, but has the functionality of touches)
https://github.com/pylapp/SmoothClicker (A more mature App but need root, it can be helpful to guide you in how to build the UI)
For the detection in the change of the pixel I still do not have a concrete answer, I keep looking, maybe obtaining a dump of the screen every X time and validate the pixels on that is the way but it is still uncertain if it is the way to go.
Something like How to record screen and take screenshots, using Android API?.
I know that you can get a bitmap dump of the screen if you have the activity, but it's not the case, however some class in the following package may be helpful https://developer.android.com/reference/kotlin/android/graphics/package-summary.
I'm currently working in my own implementation, when I have something to show I will gladly share it.

Replicating the iOS time picker in Android

I'm trying to write an app that would use the timepicker in Android, but I really would like to implement the one from iOS.
I've had a couple of leads, but haven't struck anything that has worked for me.
My problem is that the time picker is for time but I want to use mine for three different number values that can be chosen (no am/pm) so it seems like Pickers are the way to go, except that they were introduced in API 11.
I've found this blog that seems to give you some code for it, but I wasn't able to get it to work.
I also found android-wheel, but I don't know how to get the source for it. Can anyone steer me in the right direction for it?
The iOS timepicker looks like this:
Android wheel looks like this:
But, I haven't been able to figure out how to get the code for it.
The code is in the google code project - https://code.google.com/p/android-wheel/source/browse/
Download the source code from below link for various wheel example:
http://android-wheel.googlecode.com/svn/trunk/
Make sure that you have the svn plugins for download.
Thanks.

How to use com.android.calendar.DayView?

I need a calender control in my application to show some "appointments" in a day view. As far as I see it, there are two ways: Write my own control which would be not that funny and to use com.android.calendar.
Can anyone tell me how I can use com.android.calendar.DayView or whether at all it is possible. One important thing: I do not want to show the appointments of the user but rather my own dynamical added ones.
I am talking about this control:
Just for information: I am aware that there are some similar questions on SO. However, I'm interested in com.adnroid.calendar.* and not as a general question :-).
That class is not in the SDK. It is undocumented. It is unsupported.
However, it is open source. You are welcome to copy it into your own project (and refactor it into your own package), but you will be on your own to figure out how to make it work.
FWIW, there is a similarly undocumented/unsupported/open source widget in the Google I|O 2011 app.
It is possible that there are other open source implementations of this sort of widget that are documented and supported, though I can't think of any. I will probably take one of these and use it as the basis for a documented/supported widget someday, if nobody beats me to it.
I really wanted to be able to re-use DayView, so I created the yadview project (https://code.google.com/p/yadview/). yadview is a fork of the DayView schedule in the AOSP Calendar app, but has been reworked significantly to allow for integration into any application.
Sample screenshot of an Activity with this View:

How can implement captcha Using android

Can any one give some suggestions to implement captcha in android
A little bit of shameless self-promotion, but I recently had this same question, and after combing through StackOverflow.com realized that all of the solutions out there are Remote API based (which would require my simple app to require Internet permissions), and either were super difficult to implement on Android, or were limited by use based numbers and you could not get that number raised.
So I started a project, and put it on GitHub, Click here
Current features are limited, but I hope they will grow with the open-source community:
Simple Text Captcha, editable length.
Simple Math Captcha, editable math operators.
The biggest feature of all is ease of use!
Take a look to this project, they have a some android's examples
https://labs.ericsson.com/apis/captcha/downloads
https://labs.ericsson.com/apis/captcha/documentation
or maybe use this
http://simplecaptcha.sourceforge.net/
to get some ideas.

Categories

Resources