Cant add AdMob on eclipse - android

Im just tryng to put admob (4.3.1) on a android app (3.3, api 10) on eclipse (Version: 3.7.2)
following the google tutorial, at the start i have a error on
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
and then in Adding a com.google.ads.adview... I just didint know what to do, I tried 2 or 3 times, but it's not clear to me if I have to delete the Import from my project and put that or put below or above. I downloaded the sample but I seem to have errors in the activity.
So I just tried to create a banner XML and with no problems. I saved as a .apk, put on my phone (the device what I gave the device ID for test) and it just won't open, it forces close every time I try. I have almost 10 free apps on the market just waiting for ads.

Your problem is that api 10 is version 2.3.3, not 3.3. The screenSize and smallestScreenSize configChanges required by AdMob were not introduced into the Android framework until Android 3.2 (api 13). So if your project.properties has something lower than android-13, your app simply won't compile.
As for adding the AdView, I'm not sure I understand your problem. The example code is open-sourced here. Perhaps you could point to the line that is giving you issues.

Related

Using Project Tango Unity example projects

I have tried to use the Project Tango unity examples found here; https://github.com/googlesamples/tango-examples-unity with no success.
I have never used Unity before, and have successfully completed the Codelab: Motion Tracking example fromt he developer resources: https://developers.google.com/project-tango/apis/unity/unity-codelab-motion-tracking.
I downloaded the example files mentioned at the top, open one of the projects (tried several, all have the same problem). Once the project is open, I open the scene that come with it, I go to Build Settings, change platform to Android, change the Bundle Identifier and set the Minimum API Level to Jelly Bean 17 and finally click "Build and Run".
Now it starts to build the project, everything goes fine and the Unity logo shows up on the Tango. And that's it, the Unity logo shows up, no error messages on the computer, but nothing more happens. The program stalls at the Unity logo.
Am I missing some crucial step to get the example projects to actually run?
Thanks in advance!
The example code is Unity 5 based project, so please use the 5.x version of Unity to open it. If you use Unity 4.x version, the scene won't be opened up properly.
However, the code lab is based on Unity 4.6 and it is independent from our sample code. I understand this is a little bit confusing now, we are working on make sure the version are unified.
In short, I would suggest you open our example code with Unity 5.x version. You will be able to run it without a problem.
It was blank empty scene build. thats why after the unity logo it didn't load any scene or do anything.
You need to go to Unity Build Setting and drag and drop all the scenes from the examples folder in it.
Once you have all the scenes. Make sure that AreaDescriptionManagement is on the top of the list.
That is the only step missing from you.
Now, build and run. Everything should be fine.

Example NetworkUsage Android Code Crashes On Startup?

I am trying to run the example application in the networkusage.zip file on the Android Developers website (location: http://developer.android.com/training/basics/network-ops/index.html).
I have not made any changes to the code whatsoever. However, it crashes immediately on startup. I have tried setting a breakpoint in the onCreate method of the main activity, but it never gets there....just crashes right away.
I am just starting with Android, but I been able to complete other training sessions and run other example apps, so I believe my configuration works. I am running Windows 7, with Eclipse Juno and the very latest JDK and Android SDK/ADT (both downloaded about a week ago).
I am using an emulator targeting Android 4.1 (API 16).
The emulator shows a messages that says Unfortunately, NetWork Usage has stopped working.
Any help would be greatly appreciated!!
In AndroidManifest.xml file, for this project, substitute absolute android:name for NetworkActivity with relative one.
In other words, change this line:
android:name="com.example.networkusage.NetworkActivity"
to look like this:
android:name=".NetworkActivity"
The problem was that NetworkActivity is not in com.example.networkusage (as was in AndroidManifest.xml file), but in com.example.android.networkusage package. Thus, Android couldn't find the class on runtime.

xml error in Eclipse after updating Android SDK Tools

This is the error I'm getting in my layout XML files:
error!
NotFoundException: null
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)
This happened after updating my SDK tools in Eclipse. However, I can still compile my code, I just can't see the graphical part of my layout.
Recently, I also added the RootTools library, could that also be the cause?
Thank you!
I had the same problem. And it turned out to be a very strange thing.
In my strings.xml file I had a line
<string name="email_seperator_char">\#</string>
And this was causing the problem. Even if I use the escape character for # sign preview was not working after SDK update.
SOLUTION:
I just added a space in front of it and voila, it worked.
<string name="email_seperator_char"> \#</string>
I know it is strange and it may not be acceptable for some apps to have an space infront of it. But that was ok for my app. Hope this helps.
And in design mode, in graphical layout, you have a new icon, (android icon), click and select 8 minimum.
I'm not sure it helps in your case, but I found out what was the problem with mine. To support older Android devices, I lowered my project build target to API level 7 (Android 2.1) from the previous value of API Level 8 (Android 2.2).
There might be an issue with the 2.1 layout renderer, it kept crashing on my TextView's property android:textAppearance="?android:attr/textAppearanceMedium". Even when I removed it, rendering was working but had a strange appearance (grey background, tiny black text). Switching the API level back fixed the layout editor straight away.
To change it, go to your project properties, select Android on the right, then tick the box next to your desired API level under Project Build Target.
I ve got the same issue just a minutes ago, try to lower the API level, press the andorid green icon in the layout editor screen and on the dropdown menu select API 7. I think it would be work out.
I've been having similar issues. After reading a number of these posts, I've found that there is probably a bug in the layout renderer for Android 4.0.3. An error message is listed (ROOT
Exception details are logged in Window > Show View > Error Log) even when all parts of the project are set to Android 4.0.3 and SDK 15.
If I set the layout renderer to Android 2.2 and leave everything else set to Android 4.0.3, SDK 15, then it all appears to work just fine.
I hope this is useful.
there is something wrong in your TextView
one time I wrote this which cause the problem
android:textAppearance="#android:attr/textAppearanceLarge"
the Eclipse can`t tell that is wrong but the design view crashes,when I realized that,I change # to ?
android:textAppearance="?android:attr/textAppearanceLarge"
then all comes to normal

How can I get AdMob working for Android 2.3.3

I followed the instructions for adding AdMob in my app and I compiled my code againest the suggested API Level and it compiles fine and when I try to test the application on either an emulator or my device it does not work, the application crashes as soon as I navigate to the activity that has the AdMob.
I searched and tried all the threads in stack overflow and non of them seems to work for me, I was surprised when other people who posted the same problem that they say it's working for them after someone has answered them but their solution doesn't seem to work for crashing the app which no one complained about.
I tried many versions of AdMob from 4 until the latest one 6 and non seem to work. Any help or suggestion where I am doing something wrong?
By the way, I even started a new app which is 4.0.3 and still the app crashes.
Thanks
Make sure your place the library in the libs directory of your project, or in the Java Build Path, explicitly export it so that it gets bundled into your .apk file when your app compiles.

Incorporating both Contacts and ContactsContract into an Android application

Greetings all,
I realize this issue has been posed before in other forms, and believe me, I have been searching the net for days trying to find the answer. However, I'm fairly new to Android and Java, and I need a little guidance please.
I presently have two version of my app, one for Android 1.5 and 1.6, and another for 2.0 and beyond. As you probably guessed, it's because the Contacts API is different.
I recently became aware that it was possible to combine both methods into a single app, by using dynamically loadable classes. Very cool! After days of attempts, I still haven't been able to do it successfully... or at least, it won't run.
I have come across 3 examples of how to do this - one by Google, called "Business Card", another that had something to do with Spinners, and a 3rd was something someone here created. My problem is that each one seems to me to have a showstopper.
I'm using Eclipse on Windows 7. My app was first created for A1.5, so that's the one I'm upgrading. What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it. Hence, it won't run. I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.
My code for this pat of my app is exactly like the Google example "Business Card" - so if someone could help me cross this hurdle, I'd be very grateful. I'll be happy to post any code that you need to answer my question.
Thank you!
another that had something to do with Spinners
If you mean this sample project, that's mine.
I'm using Eclipse on Windows 7. My app was first created for A1.5, so that's the one I'm upgrading. What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it.
You need to set your build target (Project Properties > Android) to be high enough that ContactsContract exists (android-5 or higher).
So long as your android:minSdkVersion in your manifest is set to support earlier versions of Android (e.g., 3 for Android 1.5), your app will still install on older emulator AVDs and devices.
I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.
Yeah, don't do that.

Categories

Resources