How to Build a multi-panel User Interface in Android? - android

For My Android Application I need to design multi-panel User Interface, Like with android sdk
3.o newest version they provide a new Concept of FRAGMENT but our Android Board is running with sdk 2.3 version, I am Continuously searching to get this fragment thing by any other way , we need to design same fragment like design for Activity with sdk 2.3 API level-8,
I didnt get any way to do this,Like I am using TAB layout but it is from my side ,not much more comfortable.
Please give me some solution to get it

Depending on how soon you need this done, you might want to wait for the fragment SDK to be released by Google. They've said that fragments are fairly easy to package up for inclusion in older versions of Android. They said "soon". Unfortunately, there's really no way to know when "soon" is.

Related

Make android application using fragments to run on Android 2.X

this is my sittuation ...
A customer gave me an application done partially by somebody else. That person used fragments to build the UI.
The guy who gave me the application to finish the development of it, just realized that he wanted that the application run on android devices with 2.X
So, I am wondering if it is possible to have two UI's : One for Android devices that support fragments, and another one for android devices which do not support fragments.
In case that is possible, can that be deffined on the xml as alternate resources is done ? Or that needs to be programatically? (I mean check android os version and alternate UI's)
Thanks!
Lucky for you, the Support Library has Fragments in it, and supports back to Android 1.6. So you can use the "support" class for Fragments and it will work on old and new devices alike.
http://developer.android.com/tools/extras/support-library.html
http://developer.android.com/training/basics/fragments/support-lib.html

Android Notepad tutorial: Still "State of the art"?

I am going to make my first app for android (no fear it's just a school project and won't be another useless app in the market :>).
So, before starting this task I did some tutorials, one of these (and which I thought would be very useful, because of the sqlite part) was the Notepad Tutorial. While working through it I saw it was originally designed for Android 1.8 or something (certainly it still worked on my android 4.1).
What I'm really wondering now is:
Is this code still "state of the art" in android programming (especially sqlite, but also the rest :) or is it "deprecated"? If so, can you point me to something newer and better?
Thank you.
SQLite is definitely still the database available by default on every Android device. Also, the basics covered in this tutorial still apply to any Android version. Of course, every new version of the OS also provides new possibilities as to which controls you can use or other new APIs, but for very simple applications, this tutorial is still valid.
I skimmed the article; most of its content seem to be valid for Android 4.x.
Although I don't think the tutorial mention fragments anywhere : they were introduced with Android 3.0.
I think that an important exercise after this tutorial is to read the fragment documentation; have a look at some samples (like the gallery app) and rewrite the notepad in order to use fragments.
You will have to use the Support Library in order to use fragments if the minimum version of Android supported by your app is inferior to Android 3.0 but I think it is also an interesting exercise.
A little tip : many beginners (and experienced devs also :) ) mistakes come from adding a new element in an app but forgetting to declare it in the manifest.xml.

What SDK platforum is better to start learning with, 2.1 or 4.0.3?

I want to start programming for android devices and I have 1 question for you. I heard that Android is forward compatible. So, if I use 2.1, can I, at a later stage, update the app so it works with 4.0.3? What do you suggest me to do? Thank you for taking the time to answer these questions.
Ofcourse always start with lower version 2.1
2.1 is great for starters, but I would strongly advise to use Android Support Package for learning and implementing Fragments since Fragment based apps are the general direction in which Android is heading.
If you want to start Android Development i would Advice you to learn some Java Basics First if you are not familiar with the java envirnment.
Concerning The Android Api that you should start with, I will advice you to start with the 2.2 Froyo it's one of the most stable Api.
The choice of the android platform depends also on the fact that developer want to target the Larger Number of devices that's why google provide a chart's, that show wich platform are the most used. you can find this chart in this link.
Also in this link you can find the difference ore improvement on each platform, you can refer to the android developer site to see differences

android facing problems to use fragments in android 2.2

I am starting my programming with fragments. i want to do it for android 2.2 first then for android 3.0/3.1/3.2.
I added Compatibility package , all things i did.
What i want just give me some sample example for android 2.2 fragments for better understanding that how to use fragments in application.
there are the Api4+ and the API 13+ demos. You can download an install on your phone and try it and choose which one is the best for you. The source code is very helpful and commented.

Invoking a class from one project in another project?

I am very new to eclipse and android developing in general and need help with the following. I have built two android projects in Eclipse with the android SDK:
"ORF401 Project" - targets Android 2.2 platform
"Map Project" - targets Google APIs 2.2 platform
I have followed the steps as specified by the standard Hello World Google Maps for android tutorial and have gotten the Google map to display on the emulator when I run the second project.
I have a menu set up in the 1st project for which one of the options is to load the map. However, I'm not sure how to load the map within this project since only one build target can be specified for each project, and so I cannot specify the Google Maps API as a (additional) build target. Is there a way to call the main .java class from the second project within the first project? I see where a reference can be made to the 2nd project under the project properties, but I'm not sure how to make use of this. One possible solution I found on the web was to add the following code under the switch case in the first project:
Intent intent = new Intent(this, {googleMap}.class);
startActivity(intent);
I presume this would require an additional googleMap.java class in the first project and also another activity, but I can't get it to work. Can anyone make a suggestion as to how I can accomplish this?
If the code for either or both projects would help, I'll be happy to post it. Thanks
The main idea with projects is to have one project per application that does some thing.
I assume your application needs to do something with maps, as well as something else. There is no need to split those ideas. Keep them in one project, because they make up one single application that you develop.
First thing I would suggest - read carefully about activities and intents. Head to http://developer.android.com - everything's clearly explained.
With that all cleared up you will see the point in making some button, which, being tapped, opens a new screen with the map feature that you've developed. And then let's you go back or do something else, like open a new screen, a browser, etc.
And give up trying to call the other project from a different one :) It's not the way I think you want to do stuff.
Just to make sure I'm not misunderstood - of course you might want to have two projects. But those will most probably result in two separate applications. Luckily, applications may also interact by intents, or content providers, or a couple more. Just see how Contacts app takes you to GMail app if you want to send a mail. If that's what you want to achieve - still need to read about intents.
edit:
Here's the link I mentioned about in the comments:
http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html
It explains how to achieve the 'additional target' that you would like to have.
There are ways to call a class from one project in another project, but there are bigger problems here. The first project can run on any Android device. The second, however, requires Google Maps APIs. You won't be able to invoke it anyway, because it can't be installed unless you're in an environment that supports Google APIs. There really is no benefit to doing this, unless you have additional functionality in project 1 such that it can exist without project 2.
I would suggest using the Intent method rather than trying to hack something together that allows you to access another class. Regardless, though coupling these two together like this seems overly complicated and error prone. I would suggest simply embedding the mapping functionality in project 1 and requiring Google APIs. Most mainstream device support them anyway.
If you're married to the idea of having two separate projects with different build targets, I would suggest looking into using BroadcastReceivers with a custom intent that you broadcast from application 1. I don't believe startActivity will work across application boundaries because of class loader issues, but I could be wrong about that.

Categories

Resources