How to use page controllers in android - android

I am building an application in which I have to use page controllers (Similar to the page controllers in iphone ). I could not find any such thing in android .
Is it possible to use this in android or any alternative of this in android ...?
Thanks in advance.

There is no page controllers in Android API. But you can still use this design approach in you code I think. Just move all view interaction logic in separate controller class, leave in Activity derived class only activity specific code, like menu inflation etc.

Related

How to create and manage a multi tab Android app?

I'm trying to add multi tab functionality (browser like) to an already existent app, a mobile client for Netbox, and the goal is to implement a multi tab environment to manage more items at the same time.
This app is written in Kotlin, using android navigation (single activity) and MVVM.
Searching on the internet I didn't find a reliable solution, and I came up with an idea based on managing multiple instances of the main activity, because creating multiple instances it's quite simple.
If this solution can be considered good, I need to find a way to manage various instances to be able to switch between them, maybe with a navigation drawer.
If this solution it's unsuitable, every other idea is welcome.
See viewpager or viewpager2 ( Recommended ). https://developer.android.com/reference/androidx/viewpager2/widget/ViewPager2?hl=en

Can we still able to use activity in Xamarin Project

This is my first time doing Xamarin Form or PCL. In Xamarin Form, I can see there are few controls and pages available. Can we still able to design android layout in resource folder and called setContentView in onCreate function.
Sure you can - you're fully able to mix-and-match any Xamarin.Classic code within Xamarin.Forms . You'll have to create the Android design inside the .Droid folder and understand that this functionality will only be available on Android.
To make it work, you'll have to create a Custom Renderer. Forms will use this Custom Renderer to embed the Xamarin.Classic code inside the Forms application. I suggest you to read the documentation about this subject, or check out this video.
Take note that - if you're doing this - you're not fully using the power of Xamarin.Forms. Forms is created in such a way it should be easy to create cross-platform apps with loads of re-use. Creating Custom Renderers will make it work for one platform, but not magically for the other. The OnCreate functionality is something is available in the Xamarin.Forms lifecycle as well, which does work cross-platform.
I hope this guides you to the right direction - good luck!

Android - App with layouts only - without controllers

I'm programming an app in Android.
My client needs a 'dummy' like application, I mean, an app with all layouts but just navigable, without the actual controllers or activities, just navigate through layouts. By clicking buttons, but just pass to the other layouts without executing java or whatever code.
My question is, is this possible in AndroidStudio?
Or should I generate another kind of graphical app in order to accomplish this?
Any ideas?
Thanks in advance!
The short answer to your question (as I understood it) is no. You have to have activities to have an android app that will function. You could create a very rudimentary set of activities to do what you want.
However, if you are simply trying to create a mockup of what the app will look like for your client, I suggest using a tool like FluidUI. This will allow you to layout the general look and feel of your app without any actual code required.
Let me know if this helps!

Overlapping Activities in Android

I'm trying to implement a native MapView inside a web-based application framework (quickconnect). Right now the entire framework consists of one Activity (this is unavoidable, as the framework runs the body of the app entirely in a WebView, and the framework parses javascript calls to native functionality, such as sound and native system views). What I've realized is that MapView is an odd beast in that it needs to be run inside of a MapActivity.
So this leaves me with two options, convert the single Activity that runs the framework into a MapActivity, adding methods to manipulate the MapView inside (the issue with this is that we're looking to contribute the code back to the framework project, and the system treats MapActivities differently than normal Activities, causing all non-map apps to use up more resources than necessary), or somehow overlaying the MapActivity on top of the main Activity, which is running the WebView, with the main activity communicating with the MapActivity via Intents.
I fully realize that overlaying Activities is a complete contradiction to the design of Android apps, but I am wondering if it's possible. I've looked into ActivityGroups, and I can't find any examples of a custom ActivityGroup that shows two Activities on the screen at the same time, nevermind overlapping.
tl;dr: Is implementing overlapping Activities possible in Android, and how do I do it?
It is unclear how your objective will actually work. Let's suppose you do have "overlapping Activities". Then what? What have you gained? It's not like the JavaScript code from the first activity can do anything with the second activity. You're going to have to implement 100% of your business logic for the MapActivity in the MapActivity. Since you are going to have to teach "quickconnect" how to call startActivity() regardless, just implement your map as a regular MapActivity, in Java, and be done with it.
If, OTOH, your objective is for quickconnect-supported JavaScript code to manage the MapView, then you have no choice but to refactor the whole of quickconnect to use composition rather than inheritance, so the quickconnect engine can be used inside an Activity or a MapActivity. That may prove necessary over the long haul anyway, since FragmentActivity is necessary for using fragments in the Android Compatibility Library, and one might imagine that quickconnect should provide tablet and TV support using fragments.

Is there a UI class on Android like UINavigationController on cocoa touch?

I hope to make an Android version of my iPhone app.
Cocoa touch has UINavigationaController which can control the navigation of views(controller). It is special for the mobile device which has the small size screen.
Is there a UI class on Android like UINavigationController?
Yes, android does have an equivalent, which is part of the Fragment / FragmentManager system documented here Fragment back stack
The Android and iPhone SDKs use different paradigms for how they control views, etc. Its not really possible to take your iPhone app, rename some classes and turn it into an Android app.
I highly suggest you go read through the introductory Android documentation before going any further, so that you can understand the Android way of doing things. Start out with Application Fundamentals and work from there.
Not really. The closest thing would be an Activity with Buttons and Intents that you create. Read the document Mayra linked to.

Categories

Resources