Can't open PDF from notification activity (Android)
Kiip Integration
Hello,
I'm looking at integrating the Kiip (http://www.kiip.com/developers) service with my app. I'm looking to develop it in Titanium and release it on both iOS and android. I'm not sure whether it's possible to integrate Kiip with Titanium. Does anyone know if this is possible?
Cheers, Steve
Help me understand views in Alloy
I have read as much of the documentation on controllers and views in Alloy and I am still very perplexed at the behavior of these components.
For instance, if view2 is created from view1 without closing view 1, using:
createController("view2").getView().open()
Will I be returned to view1 once view 2 is closed?
view2.close()
Is view1 essentially view2 parent? Or is view1 a sibling of view2?
Am I creating a memory leak by calling createController("view2").getView().open()
without first closing it?
If I am going to be flipping between several views, is it best to create a controller and save it to Globals
Alloy.Globals.myController = Alloy.createController("mycontroler");
Then every time I want to use this controller, I just get the view and open it? Alloy.Globals.myController.getView().open();
Android Notification Intent doesn't start activity properly any more
What I want to achieve here is that when users click the notification, the app will open and switch to the corresponded tab within a tab group. It was working, but not anymore now. I can't find the cause. I did update the studio and sdk to 3.2.2, but even if I rolled back to an older sdk, it still didn't work. Example:
app.js
var tabgroup = require('tab'); var nNot = 0; function notify(type) { var title = null, text = null, url = null; switch (type) { case 'download': url = 'download.js'; title = 'Downloading file...'; text = 'Click here to see download details'; break; case 'music': url = 'music.js'; title = 'Music playing...'; text = 'Click here to see music details'; break; default: return; } var intent = Ti.Android.createIntent({ action: Ti.Android.ACTION_VIEW, flags: Ti.Android.FLAG_ACTIVITY_NEW_TASK, url: url }); var pending = Titanium.Android.createPendingIntent({intent: intent}); var notification = Titanium.Android.createNotification({ number: nNot++, contentTitle : title, contentText : text, contentIntent : pending }); Titanium.Android.NotificationManager.notify(nNot, notification); } // create the downloading window var win1 = Ti.UI.createWindow({layout: 'vertical'}); var btn1 = Ti.UI.createButton({title: 'Download'}); var lbl1 = Ti.UI.createLabel({text: ''}); var downloading = false; btn1.addEventListener('click', function(e) { // not really downloading anything, just create a notification if (!downloading) { lbl1.text = 'Download in progress...'; notify('download'); } else { lbl1.text = ''; } downloading = !downloading; }); win1.add(lbl1); win1.add(btn1); var tab1 = Ti.UI.createTab({ window : win1, title : 'Download' }); // create the music page var win2 = Ti.UI.createWindow({layout: 'vertical'}); var btn2 = Ti.UI.createButton({title : 'Toggle music'}); var music = Ti.Media.createAudioPlayer({ url: "/somesong.mp3", autoplay: false, allowBackground: true }); var playing = false; btn2.addEventListener('click', function(e) { if (!playing) { music.play(); notify('music'); } else { music.stop(); } playing = !playing; }); win2.add(btn2); var tab2 = Ti.UI.createTab({ window : win2, title : 'Music' }); tabgroup.addTab(tab1); tabgroup.addTab(tab2); tabgroup.open();tab.js
(function() { module.exports = Ti.UI.createTabGroup(); })();download.js
var win = Ti.UI.currentWindow; win.close(); var tab = require('tab'); tab.setActiveTab(0);music.js
var win = Ti.UI.currentWindow; win.close(); var tab = require('tab'); tab.setActiveTab(1);tiapp.xml
<android xmlns:android="http://schemas.android.com/apk/res/android"> <activities> <activity url="download.js"> <intent-filter><action android:name="android.intent.action.VIEW"/></intent-filter> </activity> <activity url="music.js"> <intent-filter><action android:name="android.intent.action.VIEW"/></intent-filter> </activity> </activities> </android>anyone has any ideas? Greatly appreciated!
Table swipe affecting multiple rows in Android
I have an app that is is pulling remote info, and making some rows and views, and appending them to the table, nothing fancy.
I have a 'swipe to reveal' setup, and it works fine on iOS, but on Android, its affecting multiple rows..
//uniqid is the key I use. It's a 100% unique key from the remote database //row is just the container to add the views too var row = Titanium.UI.createTableViewRow({ response: obj, pl_index:i, id:uniqid, typeid:'row', objName: 'row', height : 75, className : 'row' }); //row_wrapper is where labels/image are being added to, and then this is pushed to the row. This is the initial view when data is retrieved var row_wrapper = Titanium.UI.createView({ response: obj, id:uniqid, typeid:'row_wrapper', left:0, top:0, backgroundImage:'rowbg.png', borderRadius:2, //touchEnabled:false, objName: 'row_wrapper', bottom:3, right:0, opacity:1, //layout:'vertical' });row.add(row_wrapper); //menu_view is my hidden row. when swiping left on the table, row_wrapper fades out, and menu_view fades in (animations setup elsewhere) var menu_view = Titanium.UI.createView({ id:uniqid, buttonsEnabled:false, left:0, typeid:'menu_view', right:0, bottom:3, touchEnabled:false, objName: 'menu_view', backgroundColor:'#0b151b', zIndex:100, borderRadius:2, opacity:0 }); //this is used so I can find the correct one to hide/show from the MAIN SWIPE below wrapperdata[uniqid] = row_wrapper; tizendata[uniqid] = menu_view; //MAIN SWIPE //on the 'left', wrapperdata fades away, tizendata fades in. reverses on the right //the issue is that its hiding the swiped row, but also the 7th row down. swiping the 7th row to hide (or the initial) causes both to hide table.addEventListener('swipe',function(e){ Ti.API.info('source: ' + e.source); var rowdataid = e.rowData.id; Ti.API.info('direction: ' + e.direction); Ti.API.info('row id: ' + e.rowData.id); if(e.direction == 'left') { //swipe to reveal try{ wrapperdata[e.rowData.id].animate(fadeOutRow); tizendata[e.rowData.id].buttonsEnabled = true; tizendata[e.rowData.id].animate(fadeInMenu); tizendata[e.rowData.id].zIndex = 100; } catch(err){} } if(e.direction == 'right'){ try{ tizendata[e.rowData.id].animate(fadeOutMenu); wrapperdata[e.rowData.id].animate(fadeInRow); tizendata[e.rowData].buttonsEnabled = false; tizendata[e.rowData.id].zIndex = -100; } catch(err){} } });Could someone please take a look and see why they think it would be happening? It's Android only, iOS works fine ( as usual)
Trouble acceding e.data.someproerty after a facebook login
How can I access the e.data that facebook sends as a response after login in with facebook,
I can do:
Ti.API.info('e.data ' + e.data);
and get:
{"id":"1XXXX773646867X","name":"No Neo","first_name":"Neo","last_name":"Nvo","link":"https:\/\/www.facebook.com\/no.no.1","birthday":"01\/01\/1990","gender":"male","email":"mail\u0040gmail.com","timezone":-6,"locale":"es_LA","updated_time":"2014-02-28T17:47:58+0000","username":"no.ne.1"}but when I try e.data.first_name, I only get undefined
use native navigation and routing
now i wont to use navigation and routing that is in google maps and iphone i can't find it in the titanium how can i use it in my app not in the native map on mobile Thanks
Unable to create Android Project in Titanium
On Titanium for OSX. I have Android configured. Upon Creating new project I am welcomed by this error message:
http://oi58.tinypic.com/14y6cu1.jpg
I opted for Classic Option rather than Alloy
Diagnosing "Failed to compile Java source files"
Console log doesn't really give me any clues what to pursue. Is there any way of obtaining more detail about what went wrong?
[INFO] : No aidl files to compile, continuing [INFO] : Generating i18n files [INFO] : Generating D:\Titanium_Studio_Workspace\E... [INFO] : Packaging application: C:\Users\Lee.ODP\Documents\Andro... [INFO] : Building Java source files: C:\Program Files\Java\jdk1.7.0_45\bin\javac.exe "-J-Xmx256M" ... [ERROR] : Failed to compile Java source files: [ERROR] Application Installer abnormal process termination. Process exit value was 1I suspect it has to do with adding a module I created/built/referenced to this Titanium Android app. It had been building prior to this change. Would be nice if there was more than a "failed" message, pointing to something that may give me a hint on what I did wrong. I am building on Windows 7 using the latest versions of Studio, SDK, etc.
Facebook like Sliding Menu with Tab Group - Both iPhone and android
Hi, I am developing a mobile app using -
CLI version 3.2.1, Titanium SDK version 3.2.2.GA, Alloy version -1.3.1
My problem is that I want to implement a Face Book like sliding menu well as as have a tab Group so that the user can access pages both by the sliding menu and the tab bar.
For the sliding menu I have based my project on -
https://github.com/dharmik/Slider-Like-Facebook-working-in-both-android-and-iOS
The sliding menu is working good on its own. But I am struggling to use it along the Tab Group.
My code is -
index.xml ---------------- <Alloy> <TabGroup id="tgGroup" navBarHidden="true"> <Tab id="tab1" title="Tab 1"> <Window id="win1" title="Tab 1"> <Label id="label1" color="#999">I am Window 1</Label> <Require type="widget" src="com.drawermenu.widget" id="drawermenu"/> </Window> </Tab> <Tab id="tab2" title="Tab 2"> <Window id="win2" title="Tab 2"> <Label id="label2" color="#999">I am Window 2</Label> </Window> </Tab> </TabGroup> </Alloy>The functional part in the controller file -
// create menu view var data = []; var v1 = Ti.UI.createView({ height : '100%', width : '320dp', left : '0%', backgroundColor : '#212429' }); $.drawermenu.drawermenuview.add(v1); var tableView = Ti.UI.createTableView({ height : '100%', width : '100%', separatorColor : '#111214' }); v1.add(tableView); var sectionPost = Ti.UI.createTableViewRow({ height : '50dp', touchEnabled : false, width : '100%', backgroundColor : '#212429' }); var postLabel = Ti.UI.createLabel({ text : 'White Screen', color : 'white', touchEnabled : false, font : { fontSize : '18dp' } }); sectionPost.add(postLabel); var sectionInformation = Ti.UI.createTableViewRow({ height : '50dp', touchEnabled : false, width : '100%', backgroundColor : '#212429' }); var informationLabel = Ti.UI.createLabel({ text : 'Black Screen', color : 'white', touchEnabled : false, font : { fontSize : '18dp' } }); sectionInformation.add(informationLabel); data.push(sectionPost); data.push(sectionInformation); tableView.setData(data); tableView.addEventListener('click', function(e) { // $.win1.tabBarHidden =true; $.win1.hideTabBar(); // $.tgGroup.visble = false; if (e.row.children[0].text == 'White Screen') { var postScreen = Alloy.createController('postScreen').getView(); $.drawermenu.drawermainview.add(postScreen); $.drawermenu.showhidemenu(); } else if (e.row.children[0].text == 'Black Screen') { var informationScreen = Alloy.createController('informationScreen').getView(); $.drawermenu.drawermainview.add(informationScreen); $.drawermenu.showhidemenu(); } else if (e.row.children[0].text == 'Nothing') { $.drawermenu.showhidemenu(); } else { $.drawermenu.showhidemenu(); } }); var postScreen = Alloy.createController('postScreen').getView(); $.drawermenu.drawermainview.add(top10Screen); Ti.App.addEventListener('settingImg', function(data) { $.drawermenu.showhidemenu(); }); $.win1.open();From the controllers, postScreen and informationScreen I am calling the sliding menu widget in this way -
postScreen.xml --------------------------- $.settingImg.addEventListener('click', function(e) { Ti.App.fireEvent('settingImg'); });My problem is that I want to hide the tab bar at the bottom of the window when I click on a row in the table of the sliding menu but the the tab bar always appears no matter what I try :(
I have been trying for the last two days without any success and would really appreciate if some one can look in the problem and help me out.
Thanks in advance.
My app can run in an android emulator but can't in an android device
installed and configured Titanium Studio 3.2.1 with the 4.4.2 SDK. I can run my app in an emulator but when I Install to device (using Samsung note3) it show "Unfortunately, <myappname> has stopped". anyone please suggest me how to fix this issue
No Android SDKs were found under the specified SDK location
Hello, I am trying to install Titanium to use it to test Android applications After installing Titanium Studio and installing Android sdk, i get the following message : No Android SDKs were found under the specified SDK location. It seems that it is not detecting the SDK PS : I have installed SDK versions from 2.3.3 to 4.0 and i always have the same problem. Please help ! i have been trying to solve this for hours and still blocked.
Titanium on MacOSX: Unable to set Android SDK path
It is quite weird that as it appears simple it is not. I have been trying to set Android SDK Path but so far no luck. I have been seeing this for long time:
http://oi60.tinypic.com/2w38d9j.jpg
Android app only shows splash screen when no debugger is attached
When I run my Titanium app without the debugger attached, it shows the splash screen and never progresses past it.
Thinking this was my code, I created a brand new project, made no changes to it and ran that. When the debugger is attached, it runs fine and I see the Hello World view correctly. As soon as I stop the debugger, the application shows the splash screen. After killing the app, and then relaunching it, it only shows the Titanium splash screen.
I tried this with both a classic Titanium app, as well as a Titanium Alloy app. I tried it running both on my actual device (Samsung Galaxy SIII, Android 4.2.1) as well as the emulator (4.2.1, and 4.2.2). I am running Titanium Studio build 3.0.2.201302191606
Since I realize Titanium works quite well for everyone else (and has for me in the past), I can't imagine what the problem could be. I have searched over Google extensively, and looked at many options (including several related to the android 2727 bug) but nothing I have found has helped.
I would be extremely grateful if someone out there recognizes the problem and can point me to the solution, or even would like to help troubleshoot to find out what the problem is.
Thanks,
Scott
XMPP client library that supports XEP-0142
Hello everyone.
I’m actually developing a Project that consist in a mobile app that can interact between the server and the mobile app using a chat. My problem is that I can’t find a library that can make the function of XMPP client and can support the XEP-0142. Any suggestion on how could I make this possible? Any advice or library that I can use? I had in mind aSmack but it is totally developed in Java, if I’m not wrong Titanium doesn’t supports java for android developing.
Thanks
Push notification by ACS with Chinese utf-8 but receive wrong ? Question mark
I receive wrong question mark code that should be ZH_TW(ZH-rTW) UTF-8 Chinese. send to iOS is ok, but android is wrong. Does some server forget to install TW UTF-8 package?
ACS: Push Notifications and special characters
The problem
We're currently working on a project where we need to add Push Notifications to our app. Setting it up went fine and the notifications are coming through to the devices on both iOS and Android.
However we have a problem with special characters not being displayed correctly on Android (on iOS it works fine). As we are located in Denmark our clients will need to use special characters like æ, ø, å, Æ, Ø and Å. These are all shown as question marks in the Android Notification when sending form both the ACS Managing tool online and from our own .NET-program which uses the REST API.
We've tried different types of encoding (URL-encoding, UTF8-encoding and unicode-encoding) none of which helps.
Is there a specific way in which the payload must be encoded, for Android to be able to display the special characters?
Example of JSON sent with REST
// URL: https://api.cloud.appcelerator.com/v1/push_notification/notify_tokens.json?key=<our_key_here> { "channel": "test", "to_tokens": "everyone", "payload": { "alert": "Push Notification Test øæåÆØÅ" "title": "Push Notification Title" } } //Displayed on Android: // Push Notification Title // Push Notification Test ??????
Environment Information
1. Application type: mobile
2. Titanium SDK: 3.2.2GA
3. Platform and version: Android 4.2.1, Android 4.4.2
4. Device: Samsung Galaxy S2 (with CyanogenMod), Samsung Galaxy S4
5. Titanium Studio: 3.2.1.201402041146
Another query in contacts , this time in android
Hello,
Contacts are annoying . simply , i am fetching contacts using var contacts = Ti.Contacts.getAllPeople();
. The problem is that my email account is syncd to my device and now it is fetching all the contacts of phonebook and emailid. is there any filter available for this cause i want only phonebook's contacts.
App Crash
Database connection
i want to read data from my database that i have made in out side in titanium studio. why runtime error?here given my code(sorry for my weak english)
""" var db = Titanium.Database.open("DatabaseTable"); db.remove();
var dataBase = Ti.Database.install('DatabaseTable.sqlite','DatabaseTable'); dataBase.close(); exports.showData=function(){ var dataBase = Ti.Database.install('DatabaseTable.sqlite','DatabaseTable'); //var dataBase = Ti.Database.open('DatabaseTable'); var array=[]; var result=dataBase.execute('SELECT * from wordInformation'); while(result.isValidRow()){ array.push({ word : result.fieldByName('word'), meaning : result.fieldByName('meaning'), id : result.fieldByName('id'), }); result.next(); } result.close(); dataBase.close(); return array; }; """