{"id":3292,"date":"2014-03-21T20:23:05","date_gmt":"2014-03-21T20:23:05","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/androidandroid-mapviewrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-03-21T20:23:05","modified_gmt":"2014-03-21T20:23:05","slug":"androidandroid-mapviewrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/androidandroid-mapviewrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"android,android-mapviewRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2b86b9658de8687e42728e8747f176f2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser25029<br \/>\nandroid jbox2d<br \/>\nI have an android project and am trying to add JBox2D and added &#8220;jox2d-library-2.1.2.2.jar&#8221; as both a referenced library in Java Build Path|Libraries and via Android Dependencies and in both cases get the runtime error:UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lorg\/jbox2d\/callbacks\/ContactFilter;I just don&#8217;t understand why this is failing as there is only one instance of the JBox2D library jar added.Has anyone else experienced this problem?Each time befor<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1ec578f422c5e64d1a35c71bbe7e27fa?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser353877<br \/>\njava android xml-parsing<br \/>\nI am trying to parse data from the google api: http:\/\/gdata.youtube.com\/feeds\/base\/videos?q=kittens&amp;client=ytapi-youtube-search&amp;v=2&amp;start-index=1Like thistry {DocumentBuilder db = dbf.newDocumentBuilder();doc = db.parse(new InputSource(new StringReader(xml.trim())));} catch (ParserConfigurationException e) {System.out.println(&#8220;XML parse error: &#8221; + e.getMessage());return null; } catch (SAXException e) {System.out.println(&#8220;Wrong XML file structure: &#8221; + e.getMessage());return null; } ca<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/MjkMa.jpg?s=32&amp;g=1\" \/><br \/>\nmuslidrikk<br \/>\nandroid unit-testing jython monkeyrunner<br \/>\nI&#8217;m unit testing an Android app using Monkeyrunner with Jython on Eclipse.Eclipse: 4.2.1 Eclipse plugin PyDev: 2.7.1 Jython: 2.5.3When running the tests I would like it to fail at the first assertion failure.Shortened test script:if __name__ == &#8216;__main__&#8217;: # unittest.main()mDevice = getConnection()runner = unittest.TextTestRunner()suite = unittest.TestSuite()#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-suite0001 = unittest.TestLoader().loadTestsFromTestCase(Test_TEST0001)suite.addTest(suit<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c2a015998ae44c6a29c8bc032b65ed60?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSidharath<br \/>\nandroid<br \/>\nThe problem i got in showing PDF is that it will show the old PDF view as i have created new PDF in server. it is not refreshing it . sometimes it show the correct PDf and sometimes it shows the previous generated PDf. As i have deleted the previous Pdf from the server through coding and genrate new PDf through coding but still it shows the old PDF that is not available in webView.I have checked the server database the old file is deleted and new is generated and there is no issue generatin and<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9bf6271ae9d7ca1a9475915893dcfa8b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRaj<br \/>\nandroid performance activity android-fragments navigation-drawer<br \/>\nI am using Navigation drawer in my application. for this I have support libraries included in my project(support library 7 and 4). everything is fine and working well but I have a problem that is when my main activity launches then it becomes blank for 2 to 3 seconds. my main activity contains code for the navigation drawer. I have placed all the code to onResume(). I have tried different ways to overcome this problem but every time I face same problem. is this the standard time which an activit<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/222ea001964b1a6c2427bb16653c4e25?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnitish patel<br \/>\nandroid forceclose<br \/>\nI want to do some specific piece of code on settings-&gt;applications-&gt;manage applications-&gt;app name-&gt;force stop button.How can I get this force stop button event?is it possible to get this event?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/729f37e678234c371c45c49e193de2f4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser717236<br \/>\nandroid webview client-server android-webview server-side<br \/>\nTo be succinct, I want to know how android webview works underneath the covers. I&#8217;ve scoured the Internet and cannot find an article or resource which discusses the innerworkings of the webview class. It essentially is an emulator for viewing web pages in the browser, right? Does that mean it employs a strict client-server relationship, a la the Android browser, or is it more complicated than that?Is there any reason a web page will display perfectly in the Android browser, yet produce server<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a888fc8504f1333c26f2eb5f288d9545?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJohnNick<br \/>\nandroid<br \/>\nI am developing an application,In my application,I am displaying lot of images from url using DOM xml parsing,It is working fine,but some time i got org.xml.sax.SAXParseException: Unexpected end of the documentin my xml parsing handler.How to solve this problem,please help me.This is my xml parsing handler codepublic String parse_bannerlink() throws UnknownHostException{ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); String bannerlink=null; try { DocumentBuilder builder =<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/81521ecf8035d0694da3610e8b352e96?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nelwis<br \/>\nandroid adsense<br \/>\nI&#8217;m trying to get google adsense into my android app. However, as soon as I add the GoogleAdView.jar eclipse throws me the errorConversion to Dalvik format failed with error 1 Android Packaging ProblemIf I scan the console I notice the following [2010-12-19 14:45:20 &#8211; Myapp]: Dx UNEXPECTED TOP-LEVEL EXCEPTION: java.util.zip.ZipException: error in opening zip fileBut I don&#8217;t have any clue what to do about it? Give up adsense support?EDIT Created a new &#8220;Hello World&#8221; project. Worked fine until I<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2a4e69f1e616a0c818b2526aa538b6df?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAxarydax<br \/>\nandroid multi-touch android-gesture<br \/>\nI&#8217;m somehow getting unexpected results while trying to implement multitouch in my app. I&#8217;m never getting data for more than one pointer. Multitouch on my phone surely works, because I can pinch-zoom in browser and detect pinch gesture with GestureDetector, but the following sample prints action=0 pointers=1 regardless of how many fingers I use to touch the screen. Is there something in configuration\/AndroidManifest or Activity creation that I need to @Override public void onCreate(Bundle savedI<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/28d387417e63282250381cd389bd9386?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nllappall<br \/>\nandroid android-layout android-mapview<br \/>\nSo, I have this layout file:&lt;merge&gt;&lt;com.google.android.maps.MapView android:id=&#8221;@+id\/mapView&#8221;android:layout_width=&#8221;fill_parent&#8221;android:layout_height=&#8221;fill_parent&#8221;&#8230;\/&gt;&lt;LinearLayout topNavandroid:layout_width=&#8221;fill_parent&#8221;android:layout_height=&#8221;wrap_content&#8221;android:layout_gravity=&#8221;top&#8221;&#8230;\/&gt;&lt;LinearLayout bottomNav android:layout_width=&#8221;fill_parent&#8221;android:layout_height=&#8221;wrap_content&#8221;android:layout_gravity=&#8221;bottom&#8221;&#8230;\/&gt; &lt;\/merge&gt;The idea is to have a top and a bottom ba<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1feebbae4272db24fc9a9403111a4ec7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nheha<br \/>\njava android android-mapview<br \/>\nBlobCity.java:package BlobCity.xyz.com;import java.io.BufferedReader;import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Map;import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.net.Uri; import android.os.Bundle; import android.widget.*; import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener;import org.apache.http.H<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/W5ZVM.jpg?s=32&amp;g=1\" \/><br \/>\nhorse with no name<br \/>\nandroid android-mapview<br \/>\nI have two activities and each has a Mapview. The problem is that when a Mapview changes its center or zoom the other one changes too. I&#8217;ve realized that each Mapview has a different id (in xml) and a different name variable. But the problem persist. The code of each activity is too long to post here, because it implements a lot of functions. But I post the most significant part: Activity A)mapview_publish = (MapView) findViewById(R.id.mapview_publish);mapview_publish.setBuiltInZoomControls(tr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/66258e3c44015ba95b77268abe5e3226?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nendryha<br \/>\njava android google-maps map android-mapview<br \/>\nActually, the subject is a question.I want to draw on top of the map a view as overlay, simply my view consist of linear layout with 9patch background and two textview inside. I need to draw those layouts in runtime and they will be linked to geo locationThere is no problems to define such view, but it is problematic to create an overlay that will handle such draw&#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1b9f56786ceba3c57d0d2fe56182a4d3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKate Gregory<br \/>\nandroid layout android-mapview arcgis<br \/>\nI am new to Android programming and working on a project in Eclipse.I tried the first tutorial&#8217;HelloWorld&#8217;,and got this error: Could not find class &#8216;com.esri.android.map.MapView&#8217;, referenced from method com.esri.arcgis.android.samples.helloworld.HelloWorldActivity.onCreate Does there have to be a layout named MapView? If so, I do not have in my project. Could you please tell me how can I get it into the project?I also have all source folders in the project. Even mapview, don&#8217;t know why it&#8217;s show<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9c4d5def2ec42cff7eaacca6e1aa2527?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nevanskis<br \/>\niphone core-data annotations android-mapview archive<br \/>\nI have a simple iPhone app that just allows the user to add annotations to a map view, and seeing that I&#8217;m very much a beginning developer, I am trying to figure out how to save the annotations to the file system. If I were to just archive the map view, would it also save the annotations with it? And how would I go about doing that? Is it better to use Core Data or something else? Sorry, I know I have a lot of questions, I&#8217;m just very confused. Thanks!<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4c95c23f5a3bfac24acc38dce930e260?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRKN<br \/>\nandroid android-mapview viewswitcher<br \/>\nI&#8217;m trying to use the ViewSwitcher to perform switches between two views. One is an ImageView and the other is a MapView. I have a button which the user clicks to perform this switch but my codes are causing an error. Do you guys have any idea what&#8217;s about?&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;&lt;LinearLayout xmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221;android:orientation=&#8221;vertical&#8221; android:layout_width=&#8221;fill_parent&#8221;android:layout_height=&#8221;fill_parent&#8221;&gt;&lt;RelativeLayout a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b999d1e2fd1fe1328fa0e19649928fcf?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChirag_CID<br \/>\nandroid overlay android-mapview<br \/>\nI am using one overlay image in mapview to show multiple locations, now my requirement is like, when user click on that marker image, we need to change that image and should replace it with new image for that overlay only, it means if there are 5 overlay then we want to change only clicked image by user, rest 4 image should be as it is.I have put both overlays here, Marker Image,Marker should be after clicked,I do not know how to handle this thing runtime, so please suggest me how this thing can<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0a621dd70e1d6c2f2b03f9b6676abc24?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1341994<br \/>\nandroid android-mapview<br \/>\nI want to add an onClicklistener to a Button; so when I press it, it animatesTo user location. However, if there is no user location and the button is pressed, it crashes due to user location = null. How do I make it run ONLY when it is not equal to null? I have tried &#8211; private void myLocationButton() {MapView mp = (MapView) findViewById(R.id.mapView);final MapController mapController = mp.getController();final Button myLocationButton = (Button) findViewById(R.id.myLocationButton);myLocationBut<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0d3e67995e4d818dcbf9f3c061c13a40?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTroothHertz<br \/>\nandroid android-mapview<br \/>\nAfter 30 hours of programming and failing at this, I realised I couldn&#8217;t do what I wanted. So this is a last ditch effort to score a pass.Trying to implement google api to show stuff on a map.I&#8217;ve basically followed the Android tutorial entirely and it still refuses to work.It just shows the grid on the MapView, my friend tested my api key so it should be fine. The only permission I was supposed to use isandroid.permission.INTERNETI&#8217;ve seen the other thread, but I&#8217;m positive the key is fine and<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>user25029 android jbox2d I have an android project and am trying to add JBox2D and added &#8220;jox2d-library-2.1.2.2.jar&#8221; as both a referenced library in Java Build Path|Libraries and via Android Dependencies and in both cases get the runtime error:UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lorg\/jbox2d\/callbacks\/ContactFilter;I just don&#8217;t understand why this is failing as there is only [&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-3292","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3292","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=3292"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3292\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}