Non navigational options SideBar - android

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.

Related

Is it possible for a Flutter for Android activity to NOT be fullscreen? Or have no UI at all?

I'm building a somewhat basic app (only testing on Android for now) with multiple lists, one of which is an Inbox list. I can share text from other apps to my app, and it works well.
However, I would like the app to handle the intent without launching the full app UI. For example, if I share a URL from the browser to my app, I would like it to be handled in the background, save the URL to Firestore, and show a toast to the user indicating that it was successful.
Ideally, I would like to put two entries in the share menu, one to add to the Inbox and show a toast as described above, and a second entry that gives the user a modal dialog that floats above the sharing-from app, which allows the user to choose a different list to save to.
I think I'll have to make a (for example) ShareActivity.java, and add it to AndroidManifest.xml, but I have no idea where to go after that, or even if that's the right approach.

How to create a dynamic page in an Android app

Recently was given the opportunity to create an Android app for my college group. But I was not satisfied with the event page. I wanted to create a dynamic page in which admin can update the upcoming events. On using URI the images were a bit off. Can anyone help me?
If you want to create Event Page which can be changed dynamically, you should design a page such that, you give a provision of adding Events, displaying it and
refreshing the UI.
I would suggest before start implementing an App, you should gather requirements, define the features of the App, Design the App and then go after implementing.
You can use Firebase storage and Real-time database to store data and images. Also, create an admin application for changing the image.
You can have provision to add an event, persist the event details by using either database or webservice, and updating the event.
The create event page can be made dynamic by having provisions to add/subtract event detail items from the screen. For example: Use can have a section saying Number of day(s) and a + button besides it to add details about each added day.
If you want only admin user to be able to add, update, and delete the event you can use role based login (for login again, you can use either database or webservice).
These are just rough ideas, but its necessary that you freeze the requirements before jumping into designing the app.

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.

To show other Apps while exiting

I wish to show my other apps under "More Apps" section of while exiting.
What is the the best way to do it ?
Is there is any common library to add my app icon and link of my app. so that It can be shown at the time of interest. It would be great if it is scrollable
Thanks is Advance !
Well since these are your apps you can simply hard-code the icons into a RecyclerView or ListView along with a link leading to Google Play. This really doesn't require a third-party liubrary as it can easily be done by yourself.
If you really want to allow for future expansiveness, you could use a cloud platform like parse where you store the names of different apps as parse objects along with a link and an image (logo). Then you could write a custom adapter for your list which takes the parse objects from your cloud, and populates itself with the logo,link,title,etc.
This is really a matter of comfort and preference rather than finding a library to do this for you. If you need help, feel free to ask, and good luck!
You can show a 'Dialog' asking if the user cares to check some of your other apps with two available options: 'yes' and 'no'. If the user chooses
'no', close the dialog, if he chooses 'yes' - redirect him/her to the following url:
https://play.google.com/store/apps/developer?id={Your-Google-Account-Name}
This link will be opened either in the browser or in the Google Play app, whichever your user prefers, and it'll show him/her the list of all your apps.
You can try overriding finish() (Documentation) method inside your Activity. If you're using multiple Activities, consider creating a base Activity so that you don't have to implement this in each Activity.
That said, please consider not doing this. As a user, I'd be super annoyed if I'm trying to close your app and you're not letting me do it. That'd be instant uninstallation from my side. Never annoy your users. Respect their experience.

How to Dynamically Update Fragment (SlidingMenu) When View Created

I have application that uses the SlidingMenu library. It' is essentially a Fragment in the main Activity that goes in and out of view when user swypes (e.g Youtube, Google+, Facebook).
The top LinearLayout in this SlidingMenu has some Dynamic information in it. Such as Login and other info that changes as the users interacts within the app.
One example: The user opens app, that layout in SlidingMenu says "Log in". They go into overflow menu, start Login Activity (over MainFragmentActivity), signs in successfully, and Login Activity dissapears. Next time they swipe the menu open, they should see their user name, profile stats, profile picture, etc.
My question: How do I dynamically change this layout without using a refresh button?
Does this include using:
onCreateView() method in the fragment?
Note: Currently, it only updates when app starts. It starts an AsynTask to download things from MySQL. It seems like a waste of resources to hit the DB everytime user opens the panel, is there a more efficient way of using this?
You'll want to cache the content on the phone itself (probably in sqlite), you'll want check for new remote content at intervals when your application is in the foreground, and/or perhaps even use something like Google Cloud Messaging to ping your application in case the data needs to be refreshed rapidly -- but irregularly (like you would have to do with a chat application or a twitter client).
As Stephan mentioned, you can cache the data in SQLite, on top of that, you can use contentProvider, to return you a Cursor on the data stored such as login name.
Now the benefit here is that when the user logs in, you can call update in contentProvider, updating the value, and then call contentResolver.NotifyChange which will update the result in the cursor, in turn automatically update what is in the slidingMenu.

Categories

Resources