{"id":3193,"date":"2014-03-19T13:57:47","date_gmt":"2014-03-19T13:57:47","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/19\/androidadmobadviewrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-19T13:57:47","modified_gmt":"2014-03-19T13:57:47","slug":"androidadmobadviewrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/19\/androidadmobadviewrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"android,admob,adviewRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b339e03b5d8e742c56f98d45936b0944?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMark Allison<br \/>\nandroid<br \/>\nI am able to parse google map according to location name. Now my problem is when i enter a wrong location in my editbox and press enter button it crashes. I want: when no location is found then it will show a message &#8220;No Location found Enter location correctly&#8221; instead of crash. How can i do this? My parsing code is here:StringBuilder urlString = new StringBuilder();urlString.append(&#8220;http:\/\/maps.google.com\/maps?q=&#8221;);urlString.append(enter.getText().toString());\/\/fromurlString.append(&#8220;,dhaka&#8221;);ur<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d657d52776c1a794d8b30e569bc4d870?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nVitalii Korsakov<br \/>\nandroid intellij-idea library-project<br \/>\nI&#8217;ve created library project in IDEA with common helpers, which I use in my android applications. Then I&#8217;ve created android application and included in it my library project like this tutorial said. Everything seemed okay, code autocomplete worked fine, IDEA recognize that library and all classes and methods in it. But then I compiled application and saw error &#8220;&#8216;org.my.helperlibrary&#8217; does not exist&#8221;. However as I said IDEA acts like everything okay before making\/launching project.Here is similar<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e66bb815b52eb8f82eab2c06427db8ca?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nElad Benda<br \/>\njava android multithreading<br \/>\nI have read this in Android developersCaution: Another problem you might encounter when using a workerthread is unexpected restarts in your activity due to a runtimeconfiguration change (such as when the user changes the screenorientation), which may destroy your worker thread. To see how you canpersist your task during one of these restarts and how to properlycancel the task when the activity is destroyed, see the source codefor the Shelves sample application.I couldn&#8217;t clearly understand from<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e3551fcc25933cc9cd54c8f336774ee7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1204089<br \/>\nandroid vpn<br \/>\nI am trying to create a VPN client on android. I looked at android sample application &#8220;ToyVpn&#8221;, I tried to connect to my PC( Windows 7) from this app but I&#8217;m getting port unreachable exception.E\/ToyVpnService(2302): Got java.net.PortUnreachableException: E\/ToyVpnService(2302): Got java.net.SocketException: sendto failed: ECONNREFUSED (Connection refused)But when I connect to my PC via default vpn client of Android then it connects successfully. And by typing &#8220;netstat&#8221; in command line I observed<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dc643a4278351110aac11e097854161f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nbabonk<br \/>\nandroid phonegap cordova<br \/>\nI&#8217;ve been following the PhoneGap Getting Started Guide for Android. I&#8217;m on the step where it says: Type in .\/create &lt;project_folder_path&gt; &lt;package_name&gt; &lt;project_name&gt; then press &#8220;Enter&#8221;However, whenever I do this command in the form of .\/create .\/test2 com.mytest MyTest I get this error: An error occurred. Deleting project&#8230;I&#8217;m in the right directory, and I don&#8217;t believe I&#8217;ve done anything out of the ordinary in following their steps.PS I&#8217;m on Mac OS X 10.7.5Update: I tried<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/47971025216b06f1651d5b60cbb6d009?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npraveenLal<br \/>\nandroid encryption rsa<br \/>\nI have a private key and exponent, i need to implement RSA encryption of string in android application. How can i do this? Is there any default class for the RSA encryption?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9f6991f9c0fddfb21abf726499bd26e1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsachin003<br \/>\nandroid jquery html5-canvas android-webview android-4.0<br \/>\nI&#8217;m rendering a html page(html page is constructed using JQuery, text with html tags, used a canvas in it) to Activity with web-view &amp; to default browser comes with device. When I long press on text in html page I&#8217;m getting dark grey colored boxes on it.This is unexpected &amp; weird behavior of web-view.Please see attached images for my problemI searched for such issue but not getting any solution for it.Same html page is tested on Mozilla app but not getting such square boxes, also on ACER<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/506d58a313a564c1f46b19e67eb476c8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nThomasW<br \/>\nandroid osx terminal<br \/>\nI want to use adb command in a MAC appI am able to use adb commands in Terminal, in my Shell Scripts as well. I am able to use the same in the Services that I create with Automator, even in Applescripts.I am unable to use the adb command ONLY in any APP that I create using Automator. My App has a workflow that runs shell script. I am unable to use adb devices or adb for that matter, in the script; says Unexpected ErrorIs it about adding a permanent reference to adb in $PATH. I am only doing it<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/01647fd568f49ef5f1b17203a51aa92c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTom<br \/>\nandroid<br \/>\nI have come across code like this in many maps examples:&lt;RelativeLayout xmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221;xmlns:tools=&#8221;http:\/\/schemas.android.com\/tools&#8221;android:layout_width=&#8221;match_parent&#8221;android:layout_height=&#8221;match_parent&#8221;tools:context=&#8221;.MainActivity&#8221; &gt;&lt;fragmentxmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221;android:id=&#8221;@+id\/map&#8221;android:layout_width=&#8221;match_parent&#8221;android:layout_height=&#8221;match_parent&#8221;class=&#8221;com.google.android.gms.maps.SupportMapFragment&#8221;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7deca8ec973c3c0875e9a36e1e3e2c44?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSLaks<br \/>\nandroid<br \/>\nPlease help me to solve this:I have two strings for email-id and password likeString name = &#8220;xyz@gmail.com&#8221;; String pass = &#8220;abc&#8221;;I encode these two into Base64 string likeString encoded_name = new String(Base64.encode(name.getBytes(), 0)); String encoded_pass = new String(Base64.encode(pass.getBytes(), 0));and I need to concatenate these two encoded strings with space like String merge = encoded_name + &#8221; &#8221; + encoded_pass;I checked this string in console by System.out.print(&#8220;Concatenate string= &#8220;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/16e1b35a41b4524ceb072a35021144a3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMikeS<br \/>\nios admob iad ads<br \/>\nI&#8217;m using AdMob&#8217;s mediation abilities to deliver both iAds and AdMob ads to my iPhone app. However, I&#8217;m noticing something REALLY annoying from some of the AdMob ads&#8230; Some AdMob ads are opening webpages directly inside my application, in between my Nav bar and Tab bar, and aren&#8217;t displaying correctly. Instead of being fully modal like iAds, they are invading my application&#8217;s space (and doing it wrong). Are there ways to single out these AdMob ads and disable just the ones that attempt to op<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cad0436b3e7120f39e4d0fda8c90b89f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npoundifdef<br \/>\nandroid ant jar admob build.xml<br \/>\nI maintain an Android app and am not using Eclipse. I am not using Eclipse. I am using ant and build.xml and build.properties. I have places my .jar file into the libs\/ directory. My code compiles just dandy. But when I run it on the emulator, the output APK does not include the .jar, so I get a runtime stacktrace:ERROR\/AndroidRuntime(470): java.lang.NoClassDefFoundError: com.google.ads.AdViewmy build.properties looks like this:jar.libs.dir=libsAnd the libs\/ directory contains my .jar file.What<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2ed6ace44bc47ad9d7853efaa9dcb506?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nyann.debonnel<br \/>\nandroid maven admob<br \/>\nI have an Android Project where I need to build multiple versions of the same application from the same sources.To do this, I use the android plugin for MavenEach version must be able to include ads from admob. So in my POM I added this dependancy &lt;dependency&gt;&lt;groupId&gt;com.admob.android&lt;\/groupId&gt;&lt;artifactId&gt;ads&lt;\/artifactId&gt;&lt;version&gt;20101109-ANDROID-3312276cc1406347&lt;\/version&gt;&lt;scope&gt;system&lt;\/scope&gt;&lt;systemPath&gt;THE_PATH\\libs\\admob-sdk-android<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bc4e5bbe571971bbb0e8dab2678b5c46?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndjItu<br \/>\niphone ios admob<br \/>\nIve been trying to display an interstitial ad several times during my app runtime. Ive read admob documentation about it and it seems that is a one-time-use object, I&#8217;d like to know if there&#8217;s any workaround for this. Any help will be appreciated. Thanks<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/1823534463\/picture?type=large\" \/><br \/>\nGuy Cothal<br \/>\njava android admob manifest<br \/>\nI have read through about 2 dozen articles and through the Google documents and my code as it is just gives me a force close box. Here is my codeManifest&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt; &lt;manifest xmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221;package=&#8221;com.ndai.funnys&#8221;android:versionCode=&#8221;1&#8243; android:versionName=&#8221;1.0&#8243; &gt;&lt;uses-sdk android:minSdkVersion=&#8221;8&#8243; android:targetSdkVersion=&#8221;15&#8243; \/&gt;&lt;uses-permission android:name=&#8221;android.permission.INTERNET&#8221;\/&gt;&lt;uses-p<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ddadea2e191653fc94574eb3dd3a2070?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKeirDavis<br \/>\njava android view admob<br \/>\nSo here is my code, super.onCreate(savedInstanceState);RollingThunderView a = new RollingThunderView(this);setContentView(a);adView = new AdView(this, AdSize.BANNER, &#8220;ca-app-pub-XXXXXXXXXXXXXXXX\/XXXXXXXXXX&#8221;);AdRequest adRequest = new AdRequest();adRequest.addTestDevice(AdRequest.TEST_EMULATOR);adRequest.addTestDevice(&#8220;TEST_DEVICE_ID&#8221;);adView.loadAd(new AdRequest());android.view.ViewGroup.LayoutParams lp;lp = a.getLayoutParams();lp.width = a.getWidth();lp.height = a.getHeight();this.addContentVie<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/713473bb323306200abfdd5bcd96f80d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGrIsHu<br \/>\nandroid layout admob relative adview<br \/>\nFirst off- I have an admob adView set up but I need to create it dynamically due to a bug in the latest release of course.I want the ad on the bottom of the screen, and I have a linearLayout which is set to the bottom BUT there are is a restrictions which have to be otherwise the ad wont load: 1) I need to LinearLayout to be a certain height (NOT wrap content)This all works fine with a test ad, but the problem is&#8230;I was going to put this layout in a RelativeLayout so that I can align it to the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/17ce226ad23ef23c7a645814685c4bea?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1248404<br \/>\njava android xml admob<br \/>\nI just added adds to my app, but the moment i run it i get a force close from my phone and there is no logcat. I never declared it in my xml but i dont think i need to&#8230;Here&#8217;s admob.java: package isaac.n;import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.widget.Button; import android.widget.LinearLayout; import android.widget.View<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/35aa7ac54ffaef97deb3fa16df0982a5?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nuser2790945<br \/>\nlayout admob<br \/>\nHello I have a problem wich I would like to find the perfect solution for it.I am a publisher in many monetizing platforms like : admob,adfonic..for example in my main layout.I declared admob but if I wanna show adfonic I must do a whole update of my app vercion for my users would see adfonic instead.So is there anyway of control those lines or controling that xml that shows either admob of adfonic ?Thank you very much<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/203b2ce5e63ae5f5fd237cd31e0ac599?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrommex<br \/>\nandroid admob adview<br \/>\nI&#8217;m trying to include ad mob ads to my activity. I did search about this on this site so I did:input code from https:\/\/developers.google.com\/mobile-ads-sdk\/docs\/admob\/fundamentals?hl=uk#android imported the newest .jar into \/lib included the same .jar in Java Build path as an External JarI cleaned the project, I Ctrl+Shift+O&#8217;ed it.Compiling was ok, but runtime I get this error, &#8220;Couldn&#8217;t find class &#8230;..adView&#8221;.Sorry if I don&#8217;t see an obvious answer. Please help! Thnx<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/713473bb323306200abfdd5bcd96f80d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGrIsHu<br \/>\nandroid layout admob relative adview<br \/>\nFirst off- I have an admob adView set up but I need to create it dynamically due to a bug in the latest release of course.I want the ad on the bottom of the screen, and I have a linearLayout which is set to the bottom BUT there are is a restrictions which have to be otherwise the ad wont load: 1) I need to LinearLayout to be a certain height (NOT wrap content)This all works fine with a test ad, but the problem is&#8230;I was going to put this layout in a RelativeLayout so that I can align it to the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/203b2ce5e63ae5f5fd237cd31e0ac599?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrommex<br \/>\nandroid admob adview<br \/>\nI&#8217;m trying to include ad mob ads to my activity. I did search about this on this site so I did:input code from https:\/\/developers.google.com\/mobile-ads-sdk\/docs\/admob\/fundamentals?hl=uk#android imported the newest .jar into \/lib included the same .jar in Java Build path as an External JarI cleaned the project, I Ctrl+Shift+O&#8217;ed it.Compiling was ok, but runtime I get this error, &#8220;Couldn&#8217;t find class &#8230;..adView&#8221;.Sorry if I don&#8217;t see an obvious answer. Please help! Thnx<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b53e132820123b0a73eb6b62a01c2ed2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nyeahdixon<br \/>\nandroid listview admob android-arrayadapter adview<br \/>\nIM trying to put an admob AdView into a ListView by way of an ArrayAdapter. Currently it loads fine and the ad appears as expected into the listview. When I scroll, and when the row containing the ad is out of view, the app freezes. I suppose that the removal of the adview is causing some problems. Is there a way to prevent this? Or is there a way to detect when a row is being removed from the listview? Or even better is there a way that the row does not get cleared from the listview and is reta<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fcfdc5b0cbe54eedc618625f40f5572c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2502514<br \/>\njava android crash admob adview<br \/>\nMy Code: Java:import android.os.Bundle; import android.app.Activity; import android.util.AttributeSet; import android.view.Gravity; import android.view.Menu; import android.widget.LinearLayout;import com.google.ads.AdRequest; import com.google.ads.AdSize; import com.google.ads.AdView;public class MainActivity extends Activity {private AdView adView;@Override protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);adView = (AdV<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/92006b6fb4a1df177c6ef7129c287ef9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAndroid Developer<br \/>\nandroid request adview banner-ads<br \/>\nI am using an adMob banner in my application but when I run it, I got an errors as bellow:12-17 12:32:19.098: E\/Trace(1244): error opening trace file: No such file or directory (2) 12-17 12:32:19.727: D\/dalvikvm(1244): GC_FOR_ALLOC freed 55K, 3% free 8039K\/8259K, paused 60ms, total 63ms 12-17 12:32:19.907: I\/dalvikvm-heap(1244): Grow heap (frag case) to 19.900MB for 12582928-byte allocation 12-17 12:32:20.008: D\/dalvikvm(1244): GC_CONCURRENT freed 1K, 2% free 20326K\/20615K, paused 30ms+19ms, tot<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/285754fdc4f782ff05545c6446194729?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRikki Tikki Tavi<br \/>\nandroid admob adview<br \/>\nI have such layout as : &lt;RelativeLayout xmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221;xmlns:ads=&#8221;http:\/\/schemas.android.com\/apk\/lib\/com.google.ads&#8221;android:orientation=&#8221;vertical&#8221;android:layout_width=&#8221;fill_parent&#8221;android:layout_height=&#8221;fill_parent&#8221;android:id=&#8221;@+id\/archiveLayout&#8221;android:background=&#8221;#ECECFC&#8221;&gt;&lt;ListView android:id=&#8221;@android:id\/list&#8221;android:layout_alignParentTop=&#8221;true&#8221;android:layout_width=&#8221;fill_parent&#8221; android:layout_above=&#8221;@+id\/ad_layout&#8221;android:divider=&#8221;@drawabl<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e415e6bdc043fa23f4cc3b6d79f71721?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKris B<br \/>\nandroid obfuscation admob proguard adview<br \/>\nI&#8217;m using Proguard with my apps and I&#8217;m getting NullPointerExceptions sent to my Developer Console for random users. When I do a ReTrace, it seems to be an issue with the AdView I&#8217;m using. The confusing thing is, the error is happening in my Service which, obviously, doesn&#8217;t use ads. Not sure if Proguard is doing something to the code or what. This is the de-obfuscated stack trace:java.lang.NullPointerException at com.google.ads.internal.AdWebView$1.a(Unknown Source) at com.app.base.MainServ<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mark Allison android I am able to parse google map according to location name. Now my problem is when i enter a wrong location in my editbox and press enter button it crashes. I want: when no location is found then it will show a message &#8220;No Location found Enter location correctly&#8221; instead of crash. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3193","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3193"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3193\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}