Android ADT Bundle Creates appcompat and I don't what - android

I downloaded the ADT Bundle directly from android website for my mac. Everything was fine until I created a new project, and eclipse created my project as well as a folder named "appcompat_v7".
But I don't it, because that way I can't follow the tutorial, since you can't extend a method more than 1 time for example:
public class MainActivity extends ActionBarActivity
What can I do ? I can't follow any tutorial. I was trying this one (https://www.youtube.com/watch?v=E780gbh6vLU) and I can't because I have that appcompat_v7 project. The same happens with this one (http://code.tutsplus.com/tutorials/android-sdk-create-a-barcode-reader--mobile-17162)
Please I really need help, for my university project.

You can make it extend Activity and use the android.app.* versions of various classes (Activity, Fragment, etc) instead. IN your styles.xml, make your base style extend an Android-provided theme (like Theme.Holo) instead of the AppCompat one.

Related

How to work with ActionBarActivity instead of Activity

I am using eclipse for android development and last time I used it couple of months ago with API-17. But today when installing new updates from SDK manager, I am trying to create a new project. And after creation my activity is extending ActionBarActivity instead of activity. And its showing errors. Any solutions?
Plus I got the below 2 lines of importing showing error:
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
you can manually remove these if you dont need them, but they are very useful as it creates overflow menu, action bar for lower android version of its own
Import the AppCompat library into Eclipse (you may have to download it from the SDK Manager first). ActionBarActivity works the same as a normal Activity, except some method names are slightly different, e.g. getSupportActionBar() instead of getActionBar() and getSupportFragmentManager() instead of getFragmentManager().

By default android creating new project as ActionBarActivity

I recently updated eclipse, SDK and my problems are
By default it takes fragment_main.xml
Extends default activity to ActionBarActivity
By default it is adding the library appcompat 7
I dont have any issues with adding the library, but when i am trying to run then it is not executing in the device(2.3 android). I noticed it and changed to Activity.
If i extends it to Activity and run it and again for the next time the same problem arises while creating new Activity like...
Creating 2 xml files with extending ActionBarActiity.
I just want the new class to extend Activity but not ActionBarActivity where my target device is 2.3 and above without downgrading it
ActionBarActivity extends FragmentActivity and provides a nice bar(hehe) above your layout. Your editor is doing it correctly. ActionBarActivity was added in newer version of the sdk and it was added in the support library for older versions using appcompact v7(api 8). So most probably your development enviroment is correct. My guess is you need to check your imports and import ActionBarActivity from the support package.
It comes in SDK v4.4 . It is a plus point for developers because developers don't need to manually add the ActionBarActivity into their project. There are two solutions for your problem.
Downgrade your SDK to 4.3 or lower.
or
Remove ActionBarActivity and extends Activity in your java file.
Both will work for you.

Create new android project with out Fragment activity in eclipse

After the ADT update in eclipse whenever I create a new project for android a default fragment activity is created. How to get to create simple activity always?
I don't want to downgrade the ADT.
Is this possible? any work around?
The latest ADT plugins are made in such a way that if you create any simple project you will always get the FragmentActivity not a simple Activity. And you can not change it.
In new ADT itself there is Blank Activity that is defined with an actionbar and optional navigational elements such as tabs or horizontal swipe.
If you want to create simple activity in your project then you can simply create class and extends Activity into it, this is the only way now. Or you can change the Fragment with Activity simply by changing code only.
As an Activity is simply a Java class, just accept the defaults the ADT gives you during the initial creation of your project. Create your project, then manually:
1. Delete all the class and layout files in your project.
2. Create your Java class files extending Activity (in your desired packages).
3. Create XML layout files (in the res/layout folder).
4. 'Wire-up' your Java class files and XML layout files using setContentView(R.layout.YOUR_LAYOUT_ID) in the onCreate() methods.
5. Done!
EDIT
Remember to Register your Activities in the Manifest manually as well.

android adt bundle automatically extending ActionBarActivity and adding fragments and more stuff?

I just want to make a simple Hello world app that extends Activity but when I create a new android project it add all this extra stuff. It didn't use to do it before,but now everytime I create a project it extends ActionBarActivity and creates a fragment layout and has code for fragments and its no longer the simple project I used to be able to create.
How do I fix this?
I too had the same problem and this is how I fixed it.
When you create new Android Application Project, select Minimum Required SDK as API 14 or above.
If you want to support API level < 14 you can change the "minSdkVersion" in AndroidManifest.xml manually after creating the project.

Android SDK creates FragmentActivity instead of Activity

I came across this article but this article suggests replacing the FragmentActivity's code with that of the old Activity code. I can do that but would like to know if there's a way to just create Activity instead. I updated to ADT v22.6 today. Could that be the problem?
Another problem is that this requires a min-SDK of 7 while right now I want a min-SDK of 3.
Also, I am using Eclipse and not Android Studio.
Thanks in advance!
The new ADT 22.6 has new feature added that it will automatically create the any new activity as FragmentActivity not an single activity. So if you wish to create an Activity you can create it by explicitly creating separate class and extends Activity.
I'm afraid that google is enforcing us to use fragments activities instead of plain activities now. You either can go back to an SDK previous to 22.6 or just create the activities by just extending the class, adding a layout and adding the activity reference to the manifest.

Categories

Resources