Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all 7655 articles
Browse latest View live

Can't open PDF from notification activity (Android)

$
0
0
I have a notification service that uses an intermediary activity to determine if the app is active or inactive and acts accordingly. Everything works as expected if my app is active, but if my app is inactive it doesn't work properly. If its active, this activity calls a function which opens up a window allowing the user to download a PDF. If it is inactive is creates the window itself and everything works fine except when I try to download/view the PDF. It writes the file, but the activity won't start the intent for some reason. What could be the issue? here's the notification service: ~~~ /*global Ti: true, require: true */ (function (service) { //include cache object so we can store messages Ti.include("models/cache.js"); var serviceIntent = service.getIntent(), title = serviceIntent.hasExtra('title') ? serviceIntent.getStringExtra('title') : '', statusBarMessage = serviceIntent.hasExtra('message') ? serviceIntent.getStringExtra('message') : '', message = serviceIntent.hasExtra('message') ? serviceIntent.getStringExtra('message') : ''; //retrieve most recently placed message index var messageIndex=Ti.App.Cache.get('pushMessageIndex'); //if index has not been set or is over 8then reset it to 0 if(messageIndex==null || messageIndex>8) { messageIndex=0; } //else increment the index else { messageIndex++; } //cache message index (4 hrs) Ti.App.Cache.put('pushMessageIndex', messageIndex, 14400); //cache message (4 hrs) Ti.App.Cache.put('pushMessage_'+messageIndex, message, 14400); // create launcher intent var launcherIntent = Ti.Android.createIntent({ className: 'net.iamyellow.gcmjs.GcmjsActivity', packageName: Ti.App.id, defaults:Titanium.Android.NotificationManager.DEFAULT_SOUND, flags: Ti.Android.FLAG_AUTO_CANCEL | Ti.Android.FLAG_SHOW_LIGHTS }); launcherIntent.addCategory(Ti.Android.CATEGORY_LAUNCHER); // parse the json reponse var response = JSON.parse(message); var contentText=''; for(var key in response) { //key is in format label_pdfType so we need to parse var key_split = key.split("_"); if(contentText=='') { contentText+=key_split[0]; } else { contentText+=(","+key_split[0]); } } // create notification var pintent = Ti.Android.createPendingIntent({ intent: launcherIntent }), notification = Ti.Android.createNotification({ contentIntent: pintent, contentTitle: "New PDFs available", contentText: contentText, tickerText: "New event PDFs available.", icon: Ti.App.Android.R.drawable.appicon, flags: Ti.Android.FLAG_SHOW_LIGHTS | Ti.Android.FLAG_AUTO_CANCEL, defaults:Titanium.Android.NotificationManager.DEFAULT_SOUND }); Ti.Android.NotificationManager.notify(1, notification); service.stop(); })(Ti.Android.currentService); ~~~ and here's the intermediary activity: ~~~ /*global Ti: true, require: true */ (function (activity, gcm) { // 'isLauncherActivity' is a module property which tell us if the app is not running if (gcm.isLauncherActivity) { Ti.include("models/cache.js"); Ti.include("functions/mergeSortDate.js"); // loading indicator var alertActivityIndicator = Ti.UI.Android.createProgressIndicator({ message: 'Downloading...', location: Ti.UI.Android.PROGRESS_INDICATOR_DIALOG, type: Ti.UI.Android.PROGRESS_INDICATOR_INDETERMINANT, cancelable: true }); var notification_events_win=Titanium.UI.createWindow({ navBarHidden:true, layout: 'vertical', backgroundColor:'#000000', exitOnClose:true, modal:false, orientationModes: [ Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT ] }); //add event listener for physical back button. notification_events_win.addEventListener('android:back', function (e) { notification_events_win.close(); //cleanly close notification activity var activity = Titanium.Android.currentActivity; activity.finish(); }); //create a main view for the window var notificationEventsView = Titanium.UI.createScrollView({ width : "100%", backgroundColor:'black', layout: 'vertical', contentHeight: Ti.UI.SIZE, touchEnabled: true }); //create back button for window and add it to main view var backbutton= Ti.UI.createButton ( { color: 'white', title:'Close', borderRadius: 15, borderWidth: 1, borderColor: '#FF9900', backgroundColor: '#606060', width: '100%', font: { fontSize: 27.5, fontWeight: 'bold' }, top: 15, height: 55 }); backbutton.addEventListener('touchstart', function(e){ e.source.setBackgroundColor('#FF9900'); }); backbutton.addEventListener('touchend', function(e){ e.source.setBackgroundColor('#606060'); }); // add back button listener backbutton.addEventListener('click', function() { //disable button to prevent code executing multiple times this.enabled=false; //close window notification_events_win.close(); //cleanly close notification activity var activity = Titanium.Android.currentActivity; activity.finish(); }); notificationEventsView.add(backbutton); // create label var pdfDownloadLabel = Titanium.UI.createLabel({ color:'#000000', text:'Recent Event Notifications', borderRadius:5, textAlign:'center', backgroundColor:'#FF9900', borderColor:"#FF9900", top: 30, font:{fontSize:30, fontWeight: 'bold'} }); // add label to wmain view notificationEventsView.add(pdfDownloadLabel); //add view to main window notification_events_win.add(notificationEventsView); //retrieve cached notification messages var messageArray=[]; for(var i=0;i<10;i++) { var message=Ti.App.Cache.get('pushMessage_'+i); if(message!=null) { messageArray.push(JSON.parse(message)); } } var sortedNotificationData=[]; //iterate through each stored push message for(var i=0; i<messageArray.length; i++) { //iterate through message objects for(var key in messageArray[i]) { if(messageArray[i][key]) { //iterate through specific seismo ('key') events for(var j=0; j<messageArray[i][key].length; j++) { //store label and pdf type in object var key_split = key.split("_"); messageArray[i][key][j]['label']=key_split[0]; messageArray[i][key][j]['pdf_type']=key_split[1]; //reformat date var a_p=""; var date = new Date(Date.parse(messageArray[i][key][j]['date'].replace(/\-/ig, '/'))); var ap = "am"; var hour = date.getHours(); var minute = date.getMinutes(); if (hour > 11) { ap = "pm"; } if (hour > 12) { hour = hour - 12; } if (hour == 0) { hour = 12; } if (minute < 10) { minute = "0" + minute; } messageArray[i][key][j]['display_date']=(date.getMonth() + 1)+"/"+date.getDate()+" "+hour+":"+minute+" "+ap; //store event in array to be sorted later sortedNotificationData.push(messageArray[i][key][j]); } } } } //sort by date sortedNotificationData=mergeSortDate(sortedNotificationData); //generate a download button for each event object for(var k=0; k<sortedNotificationData.length; k++) { var downloadButton= Ti.UI.createButton ( { color: 'white', title: '"'+sortedNotificationData[k]['label']+'" '+sortedNotificationData[k]['display_date'], label: sortedNotificationData[k]['label'], report_id: sortedNotificationData[k]['pdf_type'], rid: sortedNotificationData[k]['rid'], tab: sortedNotificationData[k]['tab'], borderRadius: 2.5, borderWidth: 1, borderColor: '#FF9900', backgroundColor: '#424242', width: '70%', font: { fontSize: 24, fontWeight: 'bold' }, top: 15, height: 'auto' }); downloadButton.addEventListener('touchstart', function(e){ e.source.setBackgroundColor('#FF9900'); }); downloadButton.addEventListener('touchend', function(e){ e.source.setBackgroundColor('#424242'); }); // add cache on button listener downloadButton.addEventListener('click', function() { //display loading indicator alertActivityIndicator.show(); var pdfConnect = Titanium.Network.createHTTPClient(); //store label for naming PDF pdfConnect.label=this.label; //set a timeout of 15 seconds pdfConnect.setTimeout([15000]); pdfConnect.onerror= function() { alertActivityIndicator.hide(); //alert user alert("Error communicating with server."); }; // Runs the function when the data is ready for us to process pdfConnect.onload = function() { // if there is an error and there was no response text if(this.responseText==="" || this.responseText==null) { //bad response; alertActivityIndicator.hide(); alert("Error! PDF was not downloaded. Please try again."); } // account for instances in which a bad report type is used else if(this.responseText=="Unsuccessful PDF creation attempt") { alertActivityIndicator.hide(); alert("Error creating PDF. [Invalid report type]"); } // account for instances in which a bad table id is used else if(this.responseText.indexOf('Error: Unable to perform query on vault.') !== -1) { alertActivityIndicator.hide(); alert("Error creating PDF. [Invalid table ID]"); } // account for instances in which a bad record id is used else if(this.responseText=='Error: Record not found') { alertActivityIndicator.hide(); alert("Error creating PDF. [Error: Record not found]"); } // else extract the response else { try { var nameDate= new Date(); var fileName=this.label+"_"+nameDate.getDate()+"_"+nameDate.getHours()+"_"+nameDate.getMinutes()+"_"+nameDate.getSeconds()+".pdf"; //create a temp directory for the PDFs if it does not exist var Settings = Titanium.Filesystem.getFile(Ti.Filesystem.tempDirectory,'alert_pdfs'); Settings.createDirectory(); //create file from raw data var newFile = Titanium.Filesystem.getFile(Settings.nativePath,fileName); newFile.write(this.responseData); // try and open PDF in third party app if they have one Ti.Android.currentActivity.startActivity(Ti.Android.createIntent({ action: Ti.Android.ACTION_VIEW, type: 'application/pdf', data: newFile.getNativePath() })); } catch (err) { var alertDialog = Titanium.UI.createAlertDialog({ title: 'No PDF Viewer', message: 'App tried to open the PDF but failed. Please make sure you have a PDF viewing application installed on your device.', buttonNames: ['Ok'] }); alertDialog.show(); } alertActivityIndicator.hide(); } }; // values to send to the API var params = { 'username':'asdoij', 'password':'z3n0pl', 'rid':this.rid, 'tab':this.tab, 'report':this.report_id, 'logo': 'GS_RGB_Flat.png' }; //open connection to API pdfConnect.open("POST","http://thisisthesite.com/request"); //send data to API pdfConnect.send(params); }); //add button to main view notificationEventsView.add(downloadButton); } notification_events_win.open(); } else { //create window/view/buttons for event pdf download generateEventNotificationView(false); activity.finish(); } })(Ti.Android.currentActivity, require('net.iamyellow.gcmjs')); ~~~

Kiip Integration

$
0
0

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

$
0
0

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(&quot;view2&quot;).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(&quot;view2&quot;).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(&quot;mycontroler&quot;);

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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"

$
0
0

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 1
I 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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0

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

$
0
0
Hello, after upgrading Titanium 3.1.3 to 3.2.2, my Apps chrashing whith an error. I allready reinstalled everything but getting the same error.. Did someone have an solution for my problem? -- Start application log ----------------------------------------------------- [ERROR] : ResourceType: 0x5ad50008: Failed to ResTable::remove() cookie = 0x3, not last table. mHeaders.size() = 4. Warning for spontaneous crashes when the garbage collector runs. [INFO] : asset: Problem removing all runtime skin resources [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [151,151] Titanium 3.2.2 (2014/03/05 12:22 96e9a07) [ERROR] : asset: Error removing runtime skin resource (cookie 0x3) [INFO] : TiApplication: (main) [321,472] Titanium Javascript runtime: v8 [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [WARN] : V8Object: Runtime disposed, cannot set property 'userAgent' [WARN] : dalvikvm: threadid=10: thread exiting with uncaught exception (group=0x41cf78b0) [ERROR] : TiApplication: (KrollRuntimeThread) [91,91] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: Couldn't load com.mwaysolutions.barcode from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.NAVInventur-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.NAVInventur-1, /vendor/lib, /system/lib]]]: findLibrary returned null; Titanium 3.2.2,2014/03/05 12:22,96e9a07 [ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: Couldn't load com.mwaysolutions.barcode from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.NAVInventur-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.NAVInventur-1, /vendor/lib, /system/lib]]]: findLibrary returned null [ERROR] : TiApplication: at java.lang.Runtime.loadLibrary(Runtime.java:355) [ERROR] : TiApplication: at java.lang.System.loadLibrary(System.java:525) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:114) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:81) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:175) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109) [INFO] : Process: Sending signal. PID: 3597 SIG: 9

Database connection

$
0
0

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; }; """

Viewing all 7655 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>