Fragment transition? - java

Any help would be great with my issue. Basically I'm using this tutorial and its a web view fragment. So I got rid of the WebView and made new activities. My issue is connection the activities with the drawer so then every thing goes to a different activity. Once again, any idea on how to do this would be helpful.

I would recommend this tutorial instead.
http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/
I've used it and I have a functioning application at the moment. You can download the source, change the text and images if you'd like.

Related

How do I convert my existing two Activities of Android Studio into two fragments so that I can make the Navigation Bar?

I'm new in Android Studio and I've been mostly learning through experimenting so it would be really appreciated if you could explain all the steps please.
I already have an app complete which has two Activities which are connected to each other. I made this in an Empty Activity. Now I want to this to have an Navigation Bar, what do I do?
I tried making a new Navigation Bar Activity and tried to copy paste everything, it worked for the layout file with the xml file but I can't where I should be putting in my code? I searched up numerous posts to no avail. My original code had over 300 lines so I really can't write it all over again. Can someone please help me out?
I'm doing this app in Java.
You'll need to use just one main activity and convert the current activities to Fragments. So if you've not heard of Fragments see here https://www.google.com/url?sa=t&source=web&rct=j&url=https://developer.android.com/guide/fragments&ved=2ahUKEwj7wpaxxJnvAhXCx4UKHf9tAqQQFnoECAMQAg&usg=AOvVaw13OtAaEKbecXytTb4qLxel
Then you can place a navigation bar widget on the main activity, this can be configured to the amount of fragments you need.

How to implement slider view with tabs in custom keyboard or input method service

I'm working on a android keyboard app. The only problem I couldn't get around is slider tabbed view like this:
I don't know how to implement tabs with view pager in an input method service. It's fairly easy to do with activities and fragments but no idea about how to get it done in a custom keyboard.
Can anyone point me in right direction?
Is there any available library for this or a nice hack?
I'd really appreciate your help at this point.
regards,
For implementing sliding tabs with ViewPager you can refer this link or in Android studio you can select from samples available while creating a new Activity.
If you want to add library support for it you can implement this library.
Mind the min sdk version of the library to avoid any trouble in future.

Making multiple pages in android studio

I'm making a very simple app, the main page has 5 buttons, each should open a new page with different text views and buttons, since I'm new to android I want to know what is the best practice for this situation?
Should I make every page as an activity ? Or will that take a lot of resources from the phone?
If you are going to have a view fill up the entire screen you should make each page an Activity.
Android manages itself the activity stack so you dont have to worry about.
Just make sure you declare it on the manifiest, or use the Android studio assistant to make a new activity.
Hope this helps.

First android app for iOS developer

i am iOS app developer. Now when i created an app on iOS i want to do the same on android. With java i was familiar just now need some time to remember.
i was looking at some tutorial how to do one or other things. But what i can't find is the basics how everything works. How classes is interacting with each other.
For example i want to create registration window with few buttons and alerts.
I want registration window to be called just once when app is installed and just that.
Should i create new java class and few layouts, one for View with buttons and other for Alerts ?
Or should i create other class for alerts if i need them in other flow of my app ?
And how i should call that window with registration from my main class, which is
extends Activity
Also if there are some developers who came this road from objective-c (iOS) to java (android). It would be nice for some share experience how they did that.
Thank you for any help :)
Very few of the concepts in iOS and Android are similar. On Android you have Activites, Intendts the Manifest. When you design your layout it should be resolution independent. You have a search, back and a menu button and variable hardware. All of this has no equivalent in iOS.
That said, I think you just have to read the basic concepts and the getting started guide no matter if you come from iOS or never have done mobile development before.
EDIT
To answer your concrete question. Take a look at the lifecycle of an Activity and Preferences. With this, you could do some action on the first start of your main Activity and store some flag in the preferences when it's done. On the next start you just test that preference and skip the logic.
You can create one activity (.java file) and one layout(.xml file with buttons and input boxes) , alerts could be toast notifications:
http://developer.android.com/guide/topics/ui/notifiers/toasts.html
All you require for this is a activity and a layout xml for that activity, this activity will be your main ie the entry point to your application, in that activity oncreate method you can check if it is registered or not by setting a flag or something which will direct to the next activity if its registered.
GOOD LUCK...
Just like your nibs in iPhone you create xml layouts in Android. And for view controllers here you make activity. One important thing is AndroidManifest.xml file, it contains all information of your app (like plist) plus all the activity information(Intent type and launcher methods).

Android app UI design

I'm just trying to make an android app design similar to the one in the link below.
http://itunes.apple.com/gb/app/id406490694?mt=8
how would I go about making a multiple page application like this? I've only ever worked on single page applications so any advice you have would be great.
How would I make the buttons at the bottom change the page etc?
Thanks,
David
This app was designed for ios. You should make your app native to the android platform. Otherwise you will be spending a lot of time performing hacks to get the UI to look the same. You may keep some of the design but focus more on how to make this app look great for android.
In terms of switching "screens" you will need to declare each activity in the manifest like so...
<activity android:name=".YourClass"
android:label="#string/app_or_class_name" />
Then when a button or event is triggered you can use the following to load up that screen or activity.
Intent nextIntent = new Intent(v.getContext(), YourClass.class);
startActivity(nextIntent);
you should use tabActivity for this purpose with tabs at the bottom.
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I have very little android programming experience, But I think I can point you in the right direction.
http://developer.android.com/guide/topics/fundamentals/activities.html
specifically look down the page a little at "starting an activity"
It appears that tabActivity is deprecated, so.... I wouldn't use it. The dev guide points to Fragments as an alternative:
http://developer.android.com/guide/topics/fundamentals/fragments.html
good luck, and I hope someone else answers that knows a little more about it...

Categories