Android ListView - android

I would like to create a custom list view like in the Native Email application
When you click the check box you can add a click listner and do a particular action
When you long press it opens the contextual Menu
When you click the list item it performs another function like going to another activity to display that email kind.
If you can point to the code in the Native Email Application.. it would be great too :)

If it is sufficient to post a link to the app you need, here's a link to the source of Email Application.
Other resources you should check out:
Hello Views tutorial
API Demos in the samples folder of Android SDK

Related

Get share content through accessibility in android app

I have an android app, which lets people share content from other apps to it. When it receives the shared data, it looks for the URL in the shared text and fetches the page and does processing on the data fetched. This is designed with specific purpose and not a generic for all apps.
It works fine, except that people have to click the share icon and then choose our app name. With accessibility we can reduce this work for the users. We are able to get the text displayed in the app.
Is it possible to get the content which we would get if we were to click the share button.
Or
Is it possible to trigger the share button and choose our app without disturbing the user in anyway
You could try that if it's only for 1 specific app. See question How to click button in settings using AccessibilityService? which clicks a button. This will not scale if you want to do this for more apps. You could however parse the text that is on the screen and look for http links and process them in a background service and then show a floating button like Link Bubble Browser
You can simply trigger the share activity of your app when you detect the text from the other app; but the question is how will you know when user is done typing the text?!
One way is you can place a system-wide floating button similar to Facebook Messenger and after user clicks it, the text can be shared. This will reduce number of clicks user has to do.
So,
1) Yes, its possible to get text content via AccessibilityService.
2) No, you cannot automate this action.

Create link for android app items that users can click to view it in the app

I have created my first app which has sharing functionality (social media and email) for my items.
I want to extend sharing to include a link of my item in the app. Meaning: when I share an item on facebook (etc.) it will be accompanied by a link. When the user clicks that he will be taken to see the item inside my android app.
I don't know if this is possible at all. Is there a way I could generate a link for that will take the user to a specific activity displaying an item?
Any pointers and suggestions on how to approach this are welcome.
Thanks in advance,
Jonida
What you are looking for is called deep-links. You can implement them easily:
https://developer.android.com/training/app-indexing/deep-linking.html
If you are looking forward to implement them only for Facebook, you can use their service for that:
https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement

Non navigational options SideBar

Hi i was wondering if it was possible to create a Sidebar for an activity that would allow a user to select a few options such as extra information that can be associated with an object. before sending it off to a server through an API I have looked at trying to use Googles own Nav bar as well as a few Third party libraries that dont seem to want to work for me.
Encase you dont understand what im trying to achieve ill give an example:
Say i have an activity that allows the user to create a log for a specific group within the app now the user may press submit and it will be sent off to the server to be stored in a Database but the user can also associate other aspects to this log such as a book id or an activity ID.
So the user should able to pull a side bar from the side and select any extra information they need (probably from spinners or extendable listview) and then go back to the main activity and submit the log.
Is there anyway of creating anything like what im asking with out having to dig into third party libraries?
You can define arbitrary layout for your NavDrawer (I will use the name of android component here). There is no enforcement to navigation here. So, put in NavDrawer's layout a bunch of controls that you need and define their onClick, onSelected, etc. methods to handle corresponding properties changing. On submitting just get checked/selected/entered info from controls in NavDrawer, augment your data with it and send to server.

Using UiAutomator on drop down list

I'm exploring the UiAutomator capabilities on Android and I am trying to test it out along with the Google hangouts app. I've managed to go to the create new hangout page and enter a name, but I can't click on any of the drop down contacts as shown in the image below. I've tried searching by the package name com.google.android.talk and then using the instance() function, but I wasn't able to select the contacts. Is there anyway I could figure what the class name of that UI element would be? Or how else could I go about clicking that ui element?
You could try this tool:
/home/gabriel/android/android-sdk/tools/uiautomatorviewer
Use it to navigate through the application's views and layouts.

How to add custom menu item to existing email client on Android?

I have a task to add a custom menu item to Android's built-in email client. This feature shows a custome item, such as "My menu item", in the menu when the user selects an email in the list view. When the user select this custome menu item, my java code should be called and retrieves the email information, such as sender, recipients, subject, body, attachment information, etc. to do custom job.
I am a BlackBerry developer. I can do this easily on BlackBerry. But I am new to Android. I need to know:
How do I add a custome menu item into the existing email client's menu?
How do I retrieve the selected email information in the event process?
Any response is appreciated.
Lawrence
You cannot do this in Android. You cannot alter another application, and even the native e-mail client counts as an application (everything does). Perhaps with a further description of what your menu item is supposed to accomplish, we can suggest a different strategy that fits in with Android.

Categories

Resources