Android Multiuser DIsplay Different Templates - android

I have a question that I am struggling to find the answer to. What I am looking to do is create an app that will show a different template depending on the user that signs in.
For example, two users A and B. When A logs in I am hoping for them to see a tabbed template that will have features x,y and z but when B logs in I am hoping they will see a simple activity with feature c.
Ideally there will be a point of contact for the admin that will allow them manage the different templates and who sees which ones.
Is this something that can be achieved at all or is it a waste of time?

Can you please tell me exactly how you wanna show templates to the user like in listview or something else.
Secondly the thing which you want is achievable this has to be done from the server end suppose if you are showing your template in a listview so server will send you data accordingly like if user A logs in the db will give you value of the templates which your admin wants to show to your user and later you can open the templates according to the listview item selected .
Happy Coding .

Related

creating android text-based game

I am thinking about creating a text-based game (similar to gamebooks) for android device. In this moment only theoretically. Do you have some advice please, which way to go?
You probably know how gamebooks works, but the gamebook I want, will be very easy, should work like this:
User has shown some image, text and 3 options (questions), he decides which option to click, then a new page is showing (according to the clicked option) with another image, text and another 3 options. Then again, the user clicks one option, another page opens, etc.
My question is not how to do it programmatically, but how to start with this in Android Studio, what system to use for such game on android or which way to go.
Because I think it has no sense to create intents after each click, as there might be hundreds of clickable options.
I have already created such game on my website with php/html/js, but I want to create it also offline for android.
Intents implies one activity per page - unmaintainable.
You should work with a database and load based on user interaction. So you'll need to learn about Databases and Asynchronicity (working in the background while updating the UI so the user knows)

How to open page with result like contactbook?

In my UWP-App I want to create an app internal contactbook page. I can select a contact and return the selected contact back to the page where I opened the contactbook.
In Android where I come from there is a function called "startActivityForResult" which opens an activity gets the return value when finished.
I want to create the same behaviour.
I did this with Frame.Navigate(typeof(ContactBook)) and then when the contact is selected I navigate back with Frame.Navigate(typeof(PreviousPage), selectedContact)
The method Frame.GoBack() is useless in this case because I can't pass a parameter.
How can I solve this problem?
I'm not 100% familiar with android and "startActivityForResult" but are you looking to navigate the entire frame away? There isn't any equivalent in UWP apps, nor is there even really one for WPF's showDialog(), which is probably what you're looking for.
You only have a few options and none of them are really "amazing" per-say.
You can do what you've done above, which is navigate away to the page that has all the contacts, then navigate to a new page but depending on how your app is layed out you might be losing data on the page (since it's a new instance and not a back in the stack so you can't really cache it). You also can't navigate to an instance of a page either, it's only to a new page or through the stack from back / forward. If you use GoBack though and cache the page (using the "required" mode for caching) then you could do some dirty lookup of a stored value in a static class (I know, ugly and not MVVM) or setting a local settings value and reading that in the OnNavigatedTo() method for the page before.
If you don't NEED to use frame movement, you can use a flyout or a custom flyout user control to build a popup of sorts that will display the XAML for the page instead of a page frame. This will have a few difficulties with resizing (so more so for W10 than W10M) and such but you'll be able to not transition out of the frame itself. Then you can see the value of the selected and then on the submit event, you can just work with the page since it's already open.
If need be you could build a custom usercontrol for the flyout and put some custom dependency properties that can be bound for MVVM, it really all depends on what and how you're doing it.
So short answer, there is no fast way of achieveing what you're looking for and that does seem like an issue with the API. I would make the suggestion on the API's uservoice (https://wpdev.uservoice.com/forums/110705-universal-windows-platform) and try to get it upvoted!
There isn't any equivalent in UWP apps, nor is there even really one for WPF's showDialog(), which is probably what you're looking for.
#Daniel, no, there is a equivalent in UWP apps. Please refer to Launch an app for results, you can follow the tutorial in that doc to achieve this.
To do this, you will need to create two apps. One is the app which will launch the result app (let say "main app"), the other app here should be the contact-book app. The contact-book app will behavior like a modal window, and the main app will wait for the result of the contact-book app.
But in an UWP app, you can use ContactStore class to access the database that contains contacts.
So, you will need to reconsider if that is necessary to create a contact app by yourself.
Edit:
I may misunderstand your question, you just want your page to behavior like contact-book, not want to create a contact-book by yourself. But anyway, it's the same, you can create another app to hold your page which you want to launch from your main app.

Ideas On How Can I Make My Users To Navigate Between Different Quiz Type

First of all I will not post some code here because there is no idea to start with.
I'm planning on creating a quiz type app on android with different quiz type like
identification, multiple choie, matching, fill-in-the-blanks, true/false etc. And divide
them into different parts of the quiz for e.g. for Test I. Identification, Test II. Multiple
Choice and so on.. I will also give the user the capability of going back to previous parts
of the exam for e.g. I'm currently on Test III. and suddenly I got an answer for a question
from Test I., I can easily go back to that question and answer it.
Current ideas so far:
1. Create an app that implements ViewPager. Different quiz type on each pages?
2. Create a ListView put all the questions in there but all the questions are stil on their respective group first few questions is from Test I., Test II., etc. in their respective order.
Current problems encountered for the ideas above:
1. How can I submit the different forms from different pages on the ViewPager?
2. When the data contains a lot of questions the ListView will have a lot of scrolling
between each questions. To solve this, I may create a floating-like navigation(I don't
really have any idea on what to do with this) on the right side of the screen so that I can
scroll instantly to Test I. with a click of a button.
*Please consider the ideas above noob-ish, I don't really know if some of the ideas that
I'm talking about is possible or not, and please you may post the exact terminology on what
you are talking about so that I can search it up.
Ok I've decided to go with ViewPager in creating this app.
ViewPager

Only displaying pre-installed applications on android device

So I am using the Home sample to build an application that creates a second home screen for the user. The idea is to be able to have only one user account yet restrict certain access to chosen applications. I have managed to ensure that all of the applications are invisible in the XML yet I am struggling with how to change this to make certain apps visible.
Is it possible to write a whitelist of accepted apps for instance the preinstalled apps or child friendly apps for children who game using the android device and then put in a Java method to access this white list? This is the only way I can think to make it work.
If anyone knows the correct way can you please help.
Thanks.
Ok so I discovered how to do this.
In the home sample they provide a for loop in the Home.java file that covers all apps and displays them. It take a simple if statement to restrict the apps that can be viewed -
// for loop is here
if (info.activityInfo.applicationInfo.packageName.contains("com.android"))
//then the rest of the home sample is here.
Still very basic but provides me with a good enough UI so that kids cannot see apps I don't want them to.

Searching within my own application

So im building an Android application and want to include a search feature to let users use it instead of having to look through the apps many activities and pages. Cant seem to find any info on the best way to do this anywhere else. Thanks in advance
Ok so im building an app that will serve as a game guide for a popular PS3 game. Within the app will be many subjects and topics and i would like to give users the ooption to just use a search bar on the main screen of the app to search throughout the entire application and then provide them with a list of results that are clickable and take them directly to the chosen activity or place in the application. (Say it was an app for making whiskey, i would want them to be able to search on the main page for Jack Daniels instead of hitting buttons that navigate from Mainpage>American Whiskey's>Bourbon>Jack Daniels. )

Categories

Resources