Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NewsReader Program not run. Why?

 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to android. I want learn multiScreen in android and i read http://developer.android.com/training/multiscreen/index.html . I download NewsReader program and import to Eclipse but when i run this program, the program has errors and not run. I dont know why? The link written, i should add library to my application. I install android support library of android SDK manager and i copy android-support-v13.jar to libs folder. Where is my problem? How can i solve this problem?

some of errors:

Call requires API level 11 (current min is 7): android.app.ActionBar#addTab

Call requires API level 11 (current min is 7): android.app.ActionBar#newTab

and etc

Thanks for help.
Cheers.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently the manifest file specifies that this app should run on an Android version (7) that does not have the method you're trying to call (11). Given that the support library classes all have package names like "android.support.v4...." I would expect you need to use one of those classes instead of android.app.ActionBar.

Apparently there's also sample code called "Action Bar Compatibility" that comes with the SDK (assuming you have installed the support library).
 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Apparently the manifest file specifies that this app should run on an Android version (7) that does not have the method you're trying to call (11). Given that the support library classes all have package names like "android.support.v4...." I would expect you need to use one of those classes instead of android.app.ActionBar.

Apparently there's also sample code called "Action Bar Compatibility" that comes with the SDK (assuming you have installed the support library).


you mean i should not copy android-support-ver13.jar to libs folder? I right click in program name in Eclipse and select properties and select Android 2.1(API=7) and try run again but the program has errors like before change android version.

Sorry but i don't understand what you mean of --> Given that the support library classes all have package names like "android.support.v4...." I would expect you need to use one of those classes instead of android.app.ActionBar. this sentence?

Thanks for help.
Cheers
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the documentation of the android.support.v13.app library I don't see anything in there that would help with bringing ActionBar support to earlier versions; it's all about Fragment support. Why do you think it would help?

As to your second question, android.app.ActionBar does not exist in API level 7, and if you check out what's contained in the v4 support library, you won't find it in there, either. You can use the "jar" tool that comes with the JDK to find out what's contained in a jar file. Using the support libraries involves some workarounds, chiefly by using class names that are different from the standard Android classs names. That's what the android.support.* packages are all about.

Have you checked out the API sample code I mentioned? It sounds as if that is precisely what you need to work through now in order to understand how the support libraries work.
 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Looking at the documentation of the android.support.v13.app library I don't see anything in there that would help with bringing ActionBar support to earlier versions; it's all about Fragment support. Why do you think it would help?

As to your second question, android.app.ActionBar does not exist in API level 7, and if you check out what's contained in the v4 support library, you won't find it in there, either. You can use the "jar" tool that comes with the JDK to find out what's contained in a jar file. Using the support libraries involves some workarounds, chiefly by using class names that are different from the standard Android classs names. That's what the android.support.* packages are all about.

Have you checked out the API sample code I mentioned? It sounds as if that is precisely what you need to work through now in order to understand how the support libraries work.


Thanks for answer. Have you any document or link that explain about how the support libraries work?

I download this program of developer android site and and i don't write this. I mean, i don't used external and not standard library in this program.
How can i find what's contained in a jar file with JDK? If you can, please tell me.

What sample code you mentioned?!

How can i use android.app.ActionBar? When you run the program(NewsReader program in developer android site),do any problem with this?

Thanks a lot ;)
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fahimeh hashemian wrote:
What sample code you mentioned?


This is where you can download the Action Bar Compatibility sample for a demonstration of how to use ActionBar on Android 3.0+ and also support action bar functionality on older versions.

Just follow steps are mentioned.

Hope it helps.
 
fahimeh hashemian
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for answer my friends .
My problem was solved but i don't know how solved this!! I delete full of errors in Problems tab and run the program again and the program run! Anybody how solve this problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic