Similar question, but this one is about Android.
On the iPhone, there is a standard convention for editing lists. There is an Edit button and the + button above the list. You click on the Edit button and the list changes slightly notifying the user of change of status.
I have a dozen apps on Android that manage lists in some way and they all seem to do it slightly differently. Does Android have some type of a standard convention for editing lists? Perhaps something that's recommended by the Android team?
I am sure there is no such standard exist but for that you have create custom title bar with Edit/Post options same as Wordpress for Android application, you can also download this code of wordpress application because its open source application. So if you download this code, then it may be helpful to you to understand the Edit functionality for the listview.
Update:
In short, i just want to say that you have to define custom and efficient adapter for ListView.
Related
I tried almost everything. But I have many queries which need support for multiple screens in Android. For different screen resolutions, I read here in this article http://android-developers.blogspot.in/2011/07/new-tools-for-managing-screen-sizes.html. I tried that but how can I handle this if I have 50 different activities? And which code should I write in my java files?
I even searched on developer.android link, but same result. I'm really confused. How can I make my app compatible with all devices. I tried to make a different layout file for all resolutions but when it comes to the listview part having an Adapter class where we gave a layout link, it requires too much time to fix every java file. Can anyone suggest a solution for this? How do I manage this and what code I should write in my java files so it will check automatically?
Is it possible to pop up a window for a selected text within another android app ?
for example a user is using some pdf reader and selects a word and a small window pops up that provides the options to highlight the text or Define and ... , I want to know is it possible to add another option to that window (or add a small window next to that) that defines the meaning using my dictionary app, not the pdf reader's dictionary?
basically I want to know if it is possible to have the user to use my dictionary app for all his needs , surfing web, reading pdf , looking up words directly ..
No, its not possible.
Only way of do that if you upload your app to Google Play and shared the options with other apps (using PendingIntents and Broadcast actions), but the code of other apps must use your code, you can not modify other app installed.
If I have understood your question correctly then NO.
It is not possible to edit the behavior of other apps with your own since then you would have to edit that apps source code. As far as I know the system does not provide any overhead setting for what your asking as it does for sharing things whith different apps (email, social media etc.)
Android Newbie here! I spent all yesterday trying to implement a simple dialog in my android app. I realised there is no easy way out. I mean all i just wanted to show to user is a simple choice between importing a video into the app from the gallery or recording a live video. My Parent UI is already consisting of two fragments in a split-pane style(Details on the left, gridview on the right). Now i want to show the options for importing a video as a dialog. Turns out i have to create another fragment(DialogFragment), give the fragment a UI(ListView), create UI for the list items, create adapters for my list, override getView method for my adapter with custom logic. is there no shortcut to this? While this might make me sound lazy (which i'm not btw cos i love coding), what if i want to create 4 additional dialogs, do i have to do this everytime? is there no easy way out?
btw I'm targeting SDK 11 to 19 devices.
Any help will be very much appreciated.
Have you had a look at the AlertDialog.Builder?
You could use this to build your dialog and then set your click handlers on setPositiveButton and setNegativeButton methods if you only want two options.
It was added at API level 1.
I wanted to know if there is any feature in Android where I could select a word from a third party application and send or share that word to my application. I could store that word in my application for further processing.
Implementing a "share" action is easiest if you are targeting API level 14+ (Android 4.0), as documented here: Adding an Easy Share Action.
If you need to target an earlier API level, the process is a bit more involved, as documented here: Receiving Content from Other Apps.
(Note that while I normally consider link-only answers on Stack Overflow to be a poor choice, the process of implementing "share" actions is somewhat involved and fully documented on the Android developer site. This is a case where simply pointing you at the documentation seems like the most appropriate thing to do.)
Here is Android copy/paste desciption: http://developer.android.com/guide/topics/text/copy-paste.html.
But I don't think there is way to modify 3rd-party app's context menu to add custom option like share, without changing this app's source code or changing Android platform (to add your own sharing mechanism to context menu).
I am wanting to make a reusable 'landing page' activity similar to like the activity when you first launch the official twitter app, facebook, or google io app, etc. Reusable is really the key here I would like for the activity to dynamically populate its gridview with the other activities in the application.
Is it possible to parse through the android manifest file to find my other activities? If so is it also possible to add my own xml attributes to the manifest file to distinguish which activities should show up in the gridview?
Or, is there some other way to find all existing activity classes in the package? Is there a way in java to look for any Class in a package that implements a particular interface?
edit: here is a screen shot as per request
Is it possible to parse through the android manifest file to find my other activities?
No, but you can iterate over your activities via PackageManager and getPackageInfo().
If so is it also possible to add my own xml attributes to the manifest file to distinguish which
activities should show up in the gridview?
You should be able to use a <meta-data> element to point to an XML resource file that contains your extra data, just like app widgets and searching do. Use loadXmlMetaData() to access the contents.
That being said, I agree with Juri -- you're using a Buick to swat a fly here. Having a reusable dashboard activity is great -- working out the details of one is on my 18,000-item to-do list. Having one that tries to dynamically populate itself seems overkill.
I guess what you want is a dashboard. For ideas on how to implement it you could look at the source code of the Google I/O android app, more specifically at the activity_home.xml.
Parsing the manifest.xml could be an idea although I'm not sure whether you're able to access it. Honestly, being on a mobile where you want to use as little resources as possible I'd suggest you to reference your items hardcoded in the xml file, just as they did it on the Google I/O app.
The reason is that you probably want to promote just the most important activities of your app, not the detail views of a list or some custom popup alert which is also registered in the manifest and would therefore be difficult to distinguish from others.
How many activities do you have to put on the dashboard? Will the user ever be able to promote inactive activities because they want them? I think you have to consider those factors as well. Otherwise, you would weight the ones you want to show up first (different ways to do this) and then let them trickle into the dashboard.
As far as how to display which where, if you're using HTML/CSS then you could use a set width and a float model. Otherwise, just iterate through the list of promoted activities. I've done both in HTML/CSS dashboards I've done. It's just according to what your parameters are.
It's relatively easy to build a list in memory and loop from 1 to 6 assigning values to each of 6 locations on screen. Making them dynamically sized could be tricky.
Looking for more info to help you out, but not sure exactly how you're having issues. Unless you have something directly patentable, I would suggest showing code and what you're struggling with ...