adding applications onto the widgets list present in home screen - android

Hie all ,
I am trying to create an simple application and i want that application to show in the widgets list, i.e on long press on the idle home screen it pops up a spinner for us , you can see it in the below figure,
in that you can see item called widgets which list some set of the applications, even you can see that in the next diagram.. My requirement is that i want my application to be listed there rather showing the general applications list.
thanks
datta

You need to create a widget application
see these tutorials
http://www.vogella.de/articles/AndroidWidgets/article.html

Related

How do I make an Android activity like shown in this image?

How do I make an Android activity like the one shown in this image.
I am asking specifically about how to make a component such as the repeat and reminder components. And also, the two tabs showing Add Event and Add Task.
I'd also like to know the name by which they are referred.
Touching Repeat, a list dialog box appears. Touching Reminder, different times can be set which can be removed by a minus sign (-) which appears beside them. The tabs cannot be slid, but they need to be clicked to go to a particular tab.
It looks like it's just a listview on top of a tabbed activity.
When you create a new Activity, you can just specify tabbed activity and Android studio takes care of creating the tabs.
Then for the items, you just use listview, unless it'll turn out to be a really long list, then a recyclerview is recommended.
Hope that helps (:

How can i make widget of any ListView item?

I am working on the Note's application. In my appication i want to add the functionality like ColorNotes and Notes app. When i long click to any listview item then it should become the widget on main screen.
How can i build such functionality ?
you can use below link to Learn App Widget
https://developer.android.com/guide/topics/appwidgets/index.html
Use this Example for Sample this will help you to understand how will use list in Widget
https://github.com/commonsguy/cw-advandroid/tree/master/AppWidget/LoremWidget
I am going to assume that those are screenshots of Android home screens, showing some app widgets.
You cannot cause an app widget to be added to the home screen. After all, not all home screens offer app widgets. The user would have to set up the app widget themselves.
Given that the user set up the app widget, you are welcome to populate it based on a long-click of a list row in one of your activities. Use AppWidgetManager and updateAppWidget() to push a new RemoteViews to the app widget based on what the user long-clicked on.

Drag and Drop Items from Listview into Activity

In my app, I want the user to be able to follow this list of instructions to be able to put a link to their installed android apps into a widget that I am creating.
In the widget, when the user taps the widget it opens up a new activity which contains all of their apps. To add new app links to that activity, I want the user to be able to pull out a kind of scrolling tab that would hold a list of all of their applications they have on their device (I already know how to do this). The user would then be able to press and hold on a app from that listview and then drag it into the droppable area in the widget that would hold their app. Please note the picture below to get a better idea of what I mean (sorry for poor quality):
How could I turn a listview object into something that is able to do this? I would have to make the listview have a touch listener attribute and then make the droppable area have a drag event, that much I am sure of (somewhat from just looking around on how to make things drag and droppable).
How could I do this? Any ideas or comments on improvements are appreciated!
You could use setOnItemLongClickListener to set a listener waiting for a long click then when it is fired begin the drag process.

setting some checkbox to true by default for a custom ArrayAdapter

I am working on an Android app right now that will put shortcuts of apps onto the home screen.
I have everything working fine right now.
Currently the user is presented with a list of applications that are installed and they can multi select from the list with CheckBox's. However, I would like my application to already have some of the applications in the list checked by default when the user launches the app.
For instance, when the user first launches the application there are 3 of the apps that are selected by default ( for what ever reason, can be hard coded or in a properties file this does not matter right now ).
How can i do this? I basically need to be able to compare the name of the scanned application against a name in a properties file and if they match, check it by default. I have tried a couple ways and am lost. Can someone point me in the right direction or give me some hints here?
Getting the reference to the CheckBox associated with an item in the list from the custom ArrayAdapter seems to be my issue.
Thanks
I decided to basically create a class that would contain the information regarding the shortcuts. And in the class it had a boolean for holding on to the state of the selection of the checkbox. Basiclly using a MVC pattern.
Then i updated my getView() in my adapter. And added a method in my main activity for setting the default selected. Then added a method in my adapter to set the checked shortcuts and notifyDataSetChanged() everytime a change was made.
If anyone would like more detail, just comment here and i can add code if needed.

show spinner before adding widget android

For a widget I am creating for the Android OS, I want the user to first select a certain option from a Spinner. Just like when you add a shortcut to the homescreen.
Is that possible or do you have to start an Activity?
If it is possible, can anyone explain how to do it?
Spinner widgets do not exist on their own -- you have to have them in an Activity. Android's app widget framework supports the notion of a configuration activity that is automatically launched when somebody chooses your widget. Just put your Spinner in there.

Categories

Resources