{"id":597,"date":"2022-08-30T15:04:00","date_gmt":"2022-08-30T15:04:00","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/problem-about-titanium-mobile-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:04:00","modified_gmt":"2022-08-30T15:04:00","slug":"problem-about-titanium-mobile-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-titanium-mobile-collection-of-common-programming-errors\/","title":{"rendered":"problem about titanium-mobile-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6bb065feaf13c3d6aded3a3f10adb39f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2346002<br \/>\njavascript android titanium-mobile networkonmainthread<br \/>\nI read some Q&amp;A in several forums and they said Titanium does the UI operations and net work operations in two different threads. My app uses xhr calls for network operations. But my app crashes because of &#8220;android.os.NetworkOnMainThreadException&#8221;.is this possible if titanium uses different threads? is there a way to fix it?. listed below the way i&#8217;m doing my network calls, Build<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/26c1da2aa9f8d60697375971e1314455?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndaniula<br \/>\ntitanium titanium-mobile titanium-modules titanium-alloy<br \/>\nI would like to extend my controller within simple widget.I&#8217;ve created two files:app\/widgets\/mywidget\/controllers\/base.js app\/widgets\/mywidget\/controllers\/index.jsI start mycontroller.js file with line: exports.baseController = &#8216;base&#8217;; and on Android it crashes wi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d8aaa7320fecbc5b9d4740d70e236f61?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nomegatai<br \/>\ntitanium appcelerator titanium-mobile<br \/>\nMy app works fine on the iPhone simulator. However, when I launch the Android 2.2 simulator, the app loads (all the tabs appear) but then it crashes before my TableView appears. Here&#8217;s th<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/869d2bd11abd845f2b28c135de7568c7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNazar Hussain<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2a3056517f42ad77f256b553c58731f8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAnand<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/455fbf24e73d8cef3e0d0fa431d3df51?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndigitalbart<br \/>\ntitanium appcelerator titanium-mobile<br \/>\nI am trying to figure out how to pass an argument between views in alloy. I will have a have nav group which will have multiple tables, so it maybe 3 to 5 levels deep.I can pass arguments from the controller to the view but I want to pass information (ids of categories) from the view to the next table when it is clicked. I am not sure how to do this in alloy, I always get undefined errors when trying to access the variable. Below is my current setup.In my views I have: index.xml, master.xml, row.xml, detail.xml, subDetail.xmlIndex.xmlHere is my index.jsAlloy.Globals.navgroup = $.navgroup; $.master.on(&#8216;detail&#8217;, function(e) {\/\/ get the detail controller and window referencesvar controller = Alloy.createController(&#8216;detail&#8217;);var win = controller.getView();\/\/ open the detail windows $.navgroup.ope<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4e130b1ba96c6ea032b56efb8da51e25?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nneoJacob<br \/>\ntitanium titanium-mobile<br \/>\nHow can i parse this JSON feed in Titanium Mobile App . {&#8220;data&#8221;:{&#8220;mat_78&#8221;:{&#8220;id&#8221;:&#8221;78&#8243;,&#8221;title&#8221;:&#8221;latest title here&#8221;,&#8221;teaser&#8221;:&#8221;latest teaser here&#8221;,&#8221;body&#8221;:&#8221;latest body here&#8221;,&#8221;logo&#8221;:&#8221;http:\/\/sites\/default\/files\/6_0.jpg&#8221;,&#8221;files&#8221;:{&#8220;323&#8221;:{&#8220;fid&#8221;:&#8221;323&#8243;,&#8221;filename&#8221;:&#8221;joudi1m.jpg&#8221;,&#8221;tumb&#8221;:&#8221;http:\/\/sites\/default\/files\/joudi1m_0.jpg&#8221;,&#8221;large&#8221;:&#8221;http:\/\/sites\/default\/files\/joudi1_0.JPG&#8221;,&#8221;caption&#8221;:&#8221;joudi1m.jpg&#8221;}<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f56eb127cfa555e11b11260bd9accda7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndj aqeel<br \/>\nandroid titanium titanium-mobile<br \/>\nI am using titanium 3.1.0 GA. The app usually runs fine. But sometimes when launched, it crashes at random occasions on actual device. Following is the screenshot of the crash:This doesn&#8217;t seem to be a problem in my application, since most of times and in all possible scenarios, the app launches fine. But sometimes on the same device, the problem occurs. But still I show my code of app.js file, just in case:\/\/bootstrap and check dependencies if (Ti.version &lt; 1.8) {alert(&#8216;Sorry &#8211; this application template requires Titanium Mobile SDK 1.8 or later&#8217;); }(function() {var Window = require(&#8216;ui\/common\/HomeScreenWindow&#8217;);new Window().open();var and = Ti.Android;if(and){var ca=and.currentActivity;if(ca){var intent=ca.getIntent();if(intent.hasExtra(&#8220;from_my_background_service<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fe80cff5f1586741e1f03d02168d882f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nVolatil3<br \/>\njavascript titanium-mobile appcelerator-mobile<br \/>\nI am using multiple window apps being controlle via Tabgroup. I am using .js files for each window which are passed as URL with each window. I also have a function.js file where I am writing routines for<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2a3056517f42ad77f256b553c58731f8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAnand<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/91a78cf1465182161a79685058d8b39b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNanne<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/21e240605248d0c284775d808474cb6b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCaptainCarl<br \/>\nios geolocation titanium titanium-mobile<br \/>\nI&#8217;ve got a geolocation handler which deals with my GPS locations and sends them to a PHP service. This works perfectly fine on Android and is easily followed on a google maps web-app i made. However; I&#8217;ve tested it on an iPhone 4s and 4 and the coordinates jump all over<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c298feadb546a03160f95ade4f0e9bda?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKiran<br \/>\ntitanium titanium-mobile titanium-modules<br \/>\nundefined for the second argument when passing value from one screen into another screen\/\/ First Screen Code.args [] = {name:&#8217;ABCD&#8217;,value:&#8217;1234&#8242;};argsToken [] = {token:&#8217;ABC123DEF456&#8242;,value:<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4fe6487d5f7e454c84861b33c32cd2de?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMichael Frans<br \/>\nandroid geolocation gps titanium titanium-mobile<br \/>\ni&#8217;m creating simple application to get current device&#8217;s location when a button pressed. here&#8217;s my code :var win = Titanium.UI.createWindow({ title:&#8217;Tab 1&#8242;,backgroundColor:&#8217;#fff&#8217;,layout:&#8217;vertical&#8217; });var btnGetLocation = Titanium.UI.createButton({title:&#8217;Get Location (Once)&#8217;,width:&#8217;100dp&#8217; });btnGetLocation.addEventListener(&#8216;click&#8217;, function(e){getDeviceLocation(); });function getDeviceLocation(){var longitude = 0.0;var latitude = 0.0;var altitude = 0;var heading = 0;var accuracy = 0;var speed = 0;var timestamp = &#8221;;var altitudeAccuracy = 0;var address = &#8221;;var errMessage = &#8221;;if (Titanium.Geolocation.locationServicesEnabled === false){errMessage = &#8216;Geolocation access turned off&#8217;;}else{Titanium.Geoloc<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/583b8079101352ad84f06cbdbcb5a966?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonoCoetzee<br \/>\njavascript arrays titanium-mobile<br \/>\nI&#8217;ve just go into developing apps through Titanium&#8217;s Appcelerator and therefore this is my first experience with Javascript as well. Running into a confusing thing with regards to referencing array va<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5aa98e3367e3b0aaab90e1e33c2a83cc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRandom<br \/>\njavascript events titanium-mobile<br \/>\nI have a tableView that is populated from a remote source. I add several buttons on each row dynamically, buttons and content of each row are in a for loop. I have an alert dialog box listener within the button listener. Once this appears if confirm (YES) is selected I wan<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/686b5fb421bd00ad5aa8e6b973846735?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsuresh.g<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/afbe36610d176ed8889b090b6eb14019?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ngjunkie<br \/>\nsql titanium-mobile<br \/>\nI&#8217;ve looked around everywhere, but I can&#8217;t seem to find exactly what I&#8217;m trying to do. It should be fairly simple&#8230;I have a db table set up like this:var db = Ti.Database.open(&#8216;playerInfo.db&#8217;); db.execute(&#8216;CREATE TABLE IF NOT EXISTS playersTable (id INTEGER PRIMARY KEY, name TEXT NOT NULL, &#8220;50&#8221;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/563699fb1d321a7f86627ddd55168dec?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnilkash<br \/>\nandroid deployment android-emulator titanium-mobile<br \/>\nhi I have developed small Android application.I want to run it on android device.I copied .apk and run on my android device it&#8217;s working fine.But I don&#8217;t want to every time copy .apk file when I changing my code.I just wan<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cef6ada9126d544bc954c9feae87cdff?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1258134<br \/>\nfacebook login authorization titanium titanium-mobile<br \/>\nI&#8217;m getting familiar with Titanium mobile, and now I&#8217;m developing iOS app with it.I want to create custom login button. I followed some instructions on the web, but still its not working. The code is below.var win = Ti.UI.currentWindow; Titanium.Facebook<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c14ec2131c1d2da9395f5cf30e9674f3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nducktyped<br \/>\nipad ios5 segmentation-fault titanium titanium-mobile<br \/>\nI have a Titanium mobile app that is working fine on iOS simulator, But when I try to install same application on physical device, it stops installation progress in middle. I could see some error trace in organizer console. Here is the error traceJun 15 01:53:41 unknown misagent[147] : profile not valid: 0xe8008011 Jun 15 01:53:41 unknown lockdownd[21] : 001ff000 copy_phonenumber: CTSettingCopyMyPhoneNumber() returned NULL Jun 15 01:53:41 unknown lockdownd[21] : 001ff000 copy_iccid: invalid ICCID from CT\/no ICCID available Jun 15 01:53:41 unknown lockdownd[21] : libMobileGestalt copyMobileEquipmentIdentifier: No MEID in CT mobile equipment info dictionary &#8211; Check for updatesHelp -&gt; Check for Titanium updatesAfter running the &#8220;Check for Titanium updates&#8221; I always get an error message that installation failed and to see the log file for detai<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:07:03. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>user2346002 javascript android titanium-mobile networkonmainthread I read some Q&amp;A in several forums and they said Titanium does the UI operations and net work operations in two different threads. My app uses xhr calls for network operations. But my app crashes because of &#8220;android.os.NetworkOnMainThreadException&#8221;.is this possible if titanium uses different threads? is there a way to [&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-597","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/597","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=597"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/597\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}