Android Quick Actions UI Pattern - android

I'm interested in incorporating the Android UI pattern called "Quick Action". Basically, it's a context menu that doesn't cover up the data that is being acted on. I'd like to implement this but I cannot find some sample code or an API to help me out.
Note this UI pattern is discussed in the YouTube video, http://www.youtube.com/watch?v=M1ZBjlCRfz0#t=15m20s.
Does anyone have an implementation of this or know what Google's standard is for adding this to an application?

Till the official Twitter app is open sourced by Google, you may want to take a look at this implementation:
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
Really easy to use and works great.

Interesting Question. Android uses this pattern in their Contacts-App. You can get the source using git:
git clone git://android.git.kernel.org/platform/packages/apps/Contacts.git
I did this and quickly grepped it, but I didn't get a conclusive result. I think that's done in "Contacts/src/com/android/contacts/ui/QuickContactWindow.java", but I am not completely sure.
I you google for QuickContact android, there are a lot of images that show exactly the kind of menu that you want, so it seems likely that it is indeed called QuickContact in that context.
Looking at the Documentation, I don't see any inherited classes that you could use to do this for something other than contacts.
So, a few starting points, but no solution from me ;-)

This open source project has the same look and feel for the quick actions popup as the twitter app:
http://github.com/ruqqq/WorldHeritageSite/tree/master/src/sg/ruqqq/WHSFinder
It helps to download the whole project because you need a number of drawables, images, and other resources from that project.
The main demo class is called WHSListActivity.java. The other classes you need is QuickActionWindow.java, and QuickActionItem.java.
After that, it's really easy and works great. I use it for my apps.

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...

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:

Where to find Android Development Homework Problems

Ok so I am starting off with android development and I have found a bunch of useful tutorials so I am set there. What I am looking for is a resource that provides homework style problems to do and has the answers downloadable so I can check my solution against the "official" solution.
So for example instead of the notepad tutorial it would be: "Build an application that you can create, edit, delete notes, ...etc.". Ideally the "official" solution would have some explanation as to why they built it the way they did. (so a tutorial at the tail end)
Anyone know of any resources that provide their tutorials in this format?
Thanks.
Okay, here's one: build me an app that allows the user to make, modify, and store notes. The 'official' answer is the Notepad app in the 9th level of the api. (Note that this is different from the notepad tutorial).
The point is that asking questions is easy, the harder part is actually making a program that does the job. And #Roflecoptr is right, at this level it can be implemented very differently. But if you want that mindset, you can write your own 'homework' easily. Just think up a few things you want that are simple, build it, does it do what you want well? Then you pass.
Despite for very trivial problems I dont think this is possible, because there are way to much possible implementation possibilites so that you can't compare your solution to the "official" solution.
But why do you need something like that? If you want to learn to program on Android, you can just follow some tutorials you've already found and then modify them, adapt them to your needs. When you get more used to the development of Android apps you can just get some ideas on tutorials/android development sites and then implement your own solution. There is plenty of help available here on SO and on other development sites, which will help you if you really get stuck.
You could always go to the Android Samples page, and without looking at their implementations, do your own and compare. The samples page is here:
http://developer.android.com/resources/samples/index.html

android app search button

I've been trying to make my app implement the built in quick search, similar to how it is done in ApiDemos' "app/search/invoke search". I have tried everything from trying to follow different examples, to copying the code exactly as it is in ApiDemos.
All I've found for the former have been concerned with older versions of the SDK, and simply not worked. As for the stuff that I can actually run and see working in ApiDemos, I've tried copying the following
com.example.android.apis.app.SearchInvoke.java
com.example.android.apis.app.SearchQueryResults.java
com.example.android.apis.app.SearchSuggestionSampleProvider.java
res/layout/search_invoke.xml
res/layout/search_query_results.xml
res/values/arrays.xml
res/values/strings.xml
res/xml/searchable.xml
... and everything under "Search Samples" in AndroidManifest.xml
This copying gets me a view that looks exactly like the one I'm facing when running ApiDemos, but when I click the search button, in the quick search box, Android always just opens up a browser window, with Google search results for the given query. I simply cannot find the critical component in ApiDemos that tells android that I want to use my own custom code for handling the search request.
I would really appreciate some help in this matter. Both documentation and other online resources seem very lacking when it comes to this.
Thanks.
For reference, four months (and god knows how many attempts) later, I've found the part of the documentation I've missed out on, that had the whole search box behave fire up browser search results, instead of passing them to my own activity. It all comes down to a little notice found here:
Note that all user-visible strings must be provided in the form of "#string" references. Hard-coded strings, which cannot be localized, will not work properly in search metadata.
Try reading this first. If that does not help, you can try looking at the search example from one of my books -- that example integrates with the Quick Search Box, and perhaps it will give you more clues.
In addition to the examples provided by commonsware.com, you can look at the Searchable Dictionary in the samples directory of the 1.6 SDK.
http://developer.android.com/guide/samples/SearchableDictionary/index.html
I was wrong before... the SDK documentation has a thurough explanation in the docs for SearchManager that I suggest you take a look at. In addition, as CommonsWare mentioned, the blog entry is also a good resource.

Android - first launch interactive tutorial

I'm writing a new app for android and I would like to implement also a first launch tutorial. In particular, the tutorial has to be interactive. Basically, after a user registers to the service, a minimum settings will be required.
I'd like something like today we have into Google Apps, like Sheets, Docs and so far. The exception there is that those tutorials have the aim to explain how the app works. Here I want to have something where user can input some data.
I was looking at ShowcaseView but seems to be deprecated and old in style.
So here the question is: what is the best way to implement that? ViewPager?
I also had a look to this other question, but it did not help too much.
Any advice is really appreciated.
EDIT: I have found this other nice alternative. AppIntro It seems what I was looking for. :)
There are few I found by quick searching Github:
https://github.com/Seishin/showcaseview-android
https://github.com/worker8/TourGuide
https://github.com/amlcurran/ShowcaseView
I'm pretty sure you can find the right one for you ;)
You can do it in several ways that really depends on you and your app. Basically you can create a "Boarding" experience with ViewPager that will go thru the main screen of your app (with static images for example) where you explain the user what goes on in your app. The other way way is an interactive tutorial as the user already landed into your app - you can achieve this with something like Showcase (I'm pretty sure that there are libs on GitHub that are still maintained).
I would recommend Roman Nuriks Wizard Pager code on Github as a starting point. It's not so much a library as a sample code showing you how to do what you want.
The general approach is to use a ViewPager with some form of navigation buttons to move the user forwards and backwards through the pager Fragments.
https://github.com/romannurik/Android-WizardPager

Categories

Resources