-3

I've recently setup eclipse and the android SDK on a new computer but I fear something has gone wrong when setting it up.

When I create a new android project with a blank activity two files I've never seen before appear:

fragment_main.xml and appcompat_v7_2

What are they and do I need to worry about them?

enter image description here

Declan McKenna
  • 4,321
  • 6
  • 54
  • 72
  • 1
    pls read this http://stackoverflow.com/questions/22289164/adt-blank-activity-created-with-fragment-activity – Robi Kumar Tomar Jun 12 '14 at 10:28
  • Eclipse created the activity with a fragment. Anyway you can remove the files without problems. – Marco Acierno Jun 12 '14 at 10:29
  • 1
    thats is a new useful feature in development environment. you can also delete this xml files. no harm. but if you want to know more and try to use them, read above link as @RobiKumarTomar mentioned – Umit Kaya Jun 12 '14 at 10:30

2 Answers2

1

appcompat-v7 :

As stated in Android's Support Library Overview, it is considered good practice to include the support library by default because of the large diversity of devices and the fragmentation that exists between the different versions of Android (and thus, of the provided APIs)

Reference : Why does Eclipse automatically add appcompat v7 library support whenever I create a new project?

Fragment_main :

fragment_main.xml is the Layout for the fragment.

Refer this : Building a Dynamic UI with Fragments

hope this helps

Community
  • 1
  • 1
Pragnesh Ghoda シ
  • 8,318
  • 3
  • 25
  • 40
0

The first, let read code in MainActivity!

You can see fragment_main is layout of one fragment in it. when application running, fragment will be added to layout and show this layout. Let read more about here for understanding about fragment. It is very important if you want to make android app.

cuasodayleo
  • 466
  • 5
  • 16