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

Annotation can not find image (pinImage) on android for specific png

0
0

Hi guys,

I'm having a mapview with some annotations: (I'm using an alloy project, so the assets are not in the same folders as they are in traditional titanium mobile apps)

// somewhere in my code:
        // lat, lon is defined as parameters
        var marker = MapModule.createAnnotation({
            latitude : lat,
            longitude : lon,
            title : "this is the title"
            subtitle : "this is the subtitle"
            animate : true
        });
 
        if (OS_IOS) {
            marker.image = "/myImage.png"
 
            // not interesting
            marker.rightButton = Titanium.UI.iPhone.SystemButton.DISCLOSURE; 
        } else {
            // I also tried marker.pinImage 
            marker.image = "myImage.png";
            marker.rightButton = 'ic_action_about.png'; // not interesting
        }
And I have these images on my filesystem (since it does not work in android, I will only show the android folder):
+ /assets/
    + /android/
        + /images/
            + /res-long-port-hdpi/
                + myImage.png
                + ic_action_about.png
            + /res-long-port-ldpi/
                + myImage.png
                + ic_action_about.png
            +/.... (all the android res-* folders)/

The thing is:

  • The myImage.png does not have two sizes (it's the same file, same size, just copy paste). I was bit lazy with that in photoshop
  • The ic_action_about.png has both sizes, a smaller and a bigger one

My Problem now:

  • I get a red annotation if I set the marker.image to "myImage.png"
  • But somehow it works great when I change the marker.image to "ic_action_about.png"

why? Is the size too big/small and Titanium somehow recognizes that and show the default red pin, or what?

(I hope I can also help other guys with the same problem here, so it's okay to have such a huge question :D )


Selecting multiple rows on a Tableview

0
0

I'm trying to create a TableView where I can select multiple rows. I have created the following code and it appears to work to an extent.

When I click on a row, the debug statement in the click event always reports '0' for any row regardless of how many times I click on it. First time I click on a row it turns red (#f00'), but if I click on it again it doesn't turn back to white.

I can see that it is not remembering the update to the 'selected' variable. What I'm trying to do is to allow the user to select multiple rows, by selecting an unselecting them. Are you able to help me identify what this is not working please?

Thanks

var data = [
  {title:'X small',   selected:0, backgroundColor:'#fff'},
  {title:'small',     selected:0, backgroundColor:'#fff'},
  {title:'medium',    selected:0, backgroundColor:'#fff'},
  {title:'large',     selected:0, backgroundColor:'#fff'},
  {title:'X large',   selected:0, backgroundColor:'#fff'},
  {title:'XX large',  selected:0, backgroundColor:'#fff'}
];
 
var tableView = Titanium.UI.createTableView({
  allowsSelection:true,
  data:data
});
 
tableView.addEventListener('click',function(e){
   Ti.API.debug(e.rowData.selected);
   e.rowData.selected = (e.rowData.selected ? 0 : 1);
   if(e.rowData.selected) {
      e.row.backgroundColor = '#f00';
   }
   else{
      e.row.backgroundColor = '#fff';
   }
});
Application type: Mobile
Titanium SDK version: 1.8.0 (01/06/12 16:01 a3a1da4)
Device: Android emulator - Google APIs 2.2 
Host Operating System: Windows XP
Titanium Studio, build: 1.0.7.201112281340

Restart a function from another controller

0
0

Hello guys !

I have problem to restart a function defined in the principal view (index.js) from a separated controller. I work with Alloy and Titanium 3.2.2.GA (for Android)

Please let me explain :

The principal view (index.xml) contain the button 'test', with evenement onClick="openLevel"

<Alloy>
    <Window class="container">
        <View id="headerMain">
            <Label id="lblScore" class='headerMainLabel' >Score</Label>
            <Label id="lblNiveau" class='headerMainLabel' >Niveau</Label>
        </View> 
 
        <View id="middleMain">
            <ImageView  id="imgMiddle"></ImageView>
        </View> 
 
        <View id="bottomMain">
            <Button  id="start">START ! </Button>
                <Button  id="test" onClick="openLevel">TEST</Button>
            <Button  id="niveau" onClick="openNiveau">TEST</Button>
        </View> 
 
    </Window>
</Alloy>
I defined the function "openLevel" in index.js like below. Scrol is a scrollableView defined into "test.xml". The page change after x seconds... simple This code is OK.
var Scrol = Alloy.createController('Test') ;
 
function openLevel(e) {
//  Open the scrolview and change the image
    Scrol.setPage(0);
    Scrol.openScrol($.index);
    Scrol.im00.image = "/mer007.jpg" ;
 
//  Change the view after 2 seconds
    var u = setTimeout(function(e){
        Scrol.setPage(1);
    },2000);    
 
};
I defined clickable Imageview on the Page 1 of the scrollableView , This Image have evenement "onClick="ClicIm1" (Function ClicIm1 is defined into "test.js")
function ClicIm1(e) {
    // When user clic here, I want to close the controller "Test"
    // And restart the function "openLevel" defined in index.js
    // and also replace the image (Scrol.im00.image = "/mer007.jpg" --> "/mer008.jpg")
}
My question is : How to do to restart the function "OpenLevel" defined into index.js ?... (We are into "test.js" and the function is into "index.js"). and also change the image into tab 0 ?

Thanks in advance

V8Object: Runtime disposed, cannot set property 'userAgent'

0
0

Hi, While running application on Android device through appcelerator studio, application is not installing on device and its giving blank screen.

Error log:
-- Start application log ----------------------------------------------------- [INFO] : dalvikvm: Turning on JNI app bug workarounds for target SDK version 10... [ERROR] : Trace: error opening trace file: No such file or directory (2) [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiDbHelper: (main) [836,1645] No value in database for platform key: 'unique_machine_id' returning supplied default '' [INFO] : TiDbHelper: (main) [4,1649] No value in database for platform key: 'hardware_machine_id' returning supplied default '' [INFO] : I/dalvikvm-heap: Grow heap (frag case) to 17.350MB for 2362268-byte allocation [INFO] : TiApplication: (main) [807,2456] Titanium Javascript runtime: v8 [WARN] : V8Object: Runtime disposed, cannot set property 'userAgent' [INFO] : I/System.out: ActivityRecorder: before com.winwire.cisco.CiscoActivity@4294fd28_onCreate(), launchUrl = null [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [INFO] : TiAnalyticsDb: (main) [67,67] Upgrading Database from 1 to 4 [INFO] : I/System.out: ActivityRecorder: before com.winwire.cisco.CiscoActivity@4294fd28_onCreate(), launchUrl = null [INFO] : I/System.out: ActivityRecorder: before com.winwire.cisco.CiscoActivity@4294fd28_onCreate(), launchUrl = null [INFO] : I/dalvikvm-heap: Grow heap (frag case) to 22.518MB for 4096016-byte allocation [INFO] : I/System.out: ActivityRecorder: after com.winwire.cisco.CiscoActivity@4294fd28_onCreate(), launchUrl = null [INFO] : I/System.out: ActivityRecorder: after com.winwire.cisco.CiscoActivity@4294fd28_onCreate(), launchUrl = null [INFO] : I/System.out: ActivityRecorder: after com.winwire.cisco.CiscoActivity@4294fd28_onCreate(), launchUrl = null [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.winwire.cisco.CiscoActivity@4294fd28 [WARN] : TiVerify: (Timer-0) [984,984] Verifying module licenses... [INFO] : I/System.out: propertyValue:true [INFO] : I/System.out: [socket][0] connection /54.214.252.38:80;LocalPort=53904(15000) [INFO] : I/System.out: [CDS]connect[/54.214.252.38:80] tm:15 [INFO] : I/System.out: [socket][/192.168.1.161:53904] connected [INFO] : I/System.out: [CDS]rx timeout:15000 [INFO] : I/System.out: >doSendRequest [INFO] : I/System.out: <doSendRequest [INFO] : I/System.out: [CDS]close53904 : I/System.out: close [socket][/0.0.0.0:53904] [INFO] : I/System.out: close [socket][/0.0.0.0:53904] [INFO] : TiVerify: (Timer-0) [1031,2015] Succesfully verified module licenses

Getting a real Image size (width and height)

0
0

Thanks in advance, I'm really getting crazy with this.

It's possible to get a real image size? it´s in "photos" folder of my "resources" folder. I had test much more things and find and find everywhere, but no solution.

My platform is android.

Please help me.

Android Tableview Swipe cancels scrolling

0
0

I have a tableview that scrolls and populates fine. When I add an empty function to listen to "swipe", the scrolling becomes jerky and the tableview stops scrolling on finger release. Has anyone seen this or know how to handle this?

Ti SDK 3.2.2 Alloy 1.3 Android platform

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!

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?


Email attachment

0
0

Hi all i had written code for email dialoge to open email from my application but the problem is am not able to send attachments. and my requirement is i need add multiple attachments to email. but im not able to do it well i'm trying to execute in both platforms ios and android.

var emailDialog = Ti.UI.createEmailDialog({
        html : true
    });
    emailDialog.subject = "Kindly enter the subject";
    emailDialog.toRecipients = "jkusuma12@gmail.com";
var link;
for (var j = 0; j < array.length; j++) {
             link = Ti.Filesystem.getFile(link);
 
        }
 
emailDialog.addAttachment(link);
emailDialog.messageBody = "<html><body>" + link + "</body></html>";
        emailDialog.open();
and one more thing is email dialog opens before for loop runs means statements are running asynchornuslly how can i handle it.

How to flip or mirror or horizontally scale an image

0
0

No animation involved. Works on Android, latest SDKs.

var aMatrix = Ti.UI.create2DMatrix();
 
var anImageView = Ti.UI.createImageView({
   image:foo.jpg,
   width:100+"%",
   left:0,
   top:0,
   transform:aMatrix.scale(-1, 1)
});

Why I cannot create a simple menu?

0
0

Why is it so had to just create a simple menu to link some file.js ??

var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({  
    backgroundColor: "#FFF"
});
var tab = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Testing',
    window:win
});
var regItems = [ 
    {title: "Menu 1", font:{fontSize: 25, fontWeight: 'bold'}, color: "#45165C", leftImage:"images/regImg.gif", className: "tableRow", hasDetail: true},
    {title: "Menu 2", font:{fontSize: 25, fontWeight: 'bold'}, color: "#45165C", leftImage:"images/regImg.gif", className: "tableRow", hasDetail: true}
];
var regItemList = Titanium.UI.createTableView({
    data: regItems
});
 
regItemList.addEventListener('click', function(e){
     var win2 = Titanium.UI.createWindow({ 
        url: "newWin.js",
        title: e.rowData.title,
        backgroundColor: "#273691"
     });
     win2.open();
});
win.add(regItemList);
 
tabGroup.addTab(tab);
tabGroup.open();
So I have this code that only shows a table view with some menu, but if you click Menu 1 or Menu 2, it just calls the same script "newWin.js", why I cannot choose or ready the properties of each one so I can select what script to call?

And why if I try to add another tableview it only shows the last one? This is very confusing, I can't understand why this is so hard :/

I've been looking up on the internet and I found that I have to create a menu for Android and another one for iOs, isn't it supposed that Titanium was designed to work with several of mobile OS without creating a single type of menu for each one?

'Installing Titanium Updates...' has encountered a problem!

0
0

This is the whole error message that appears:

Error encountered during update

org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 112462407; received: 112446347 org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 112462407; received: 112446347 Premature end of Content-Length delimited message body (expected: 112462407; received: 112446347

I know that there could be more reasons causing this error.. Im my case what can I do to fix this error? Thanks in advance Helmut

Native maps navigation, how to

0
0

I'm working in an android and iphone app and I've implemented Google Maps and "Ios maps" (not sure how they are called".

My problem is adding the native navigation options. In case of google maps, it should be possible to do things like add local to favorites or choose if we want to go on public transports/walking/car.

My idea was, when the user clicks on the map, it re-forwards him to the native navigation app and there the user has access to all the function he/she needs.

Is this possible? If so, how ? Whats the best way to achieve this or something similar?

How To Send Https Request And Install Certificate Titanium Alloy

0
0

I want to send request using HTTPS. Which goes with installing the certificate at client end also. what will be the request parameter in HTTPS, added extra when compare to normal HTTP request. I send request In SOAP Envelop for HTTP protocol, Now my services layer moved to HTTPS now i need to install the certificate, How to install the certificate in titanium alloy mobile application?

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

Session Handling in titanium

0
0

Hi Everyone,

             i hve login and signup functionality in my app. After login i want user to interact with server data . And after logout i want to refresh my app and only show local data available. Is there any way to maintain session of users?

Email with multiple file attachment in titanium android

0
0
How to send email with multiple image file as attachment? . I tried but the last chosen image is only being attached in mail, other images are not attaching. I am using Titanium 3.x and platform is android. My code is ``` function ShowEmailWindow() { setTimeout(function() { var emailDialog = Ti.UI.createEmailDialog(); emailDialog.subject = "Harcourts"; emailDialog.toRecipients = ['']; emailDialog.messageBody = 'Thank you '; if (Ti.Platform.osname == 'android') { for (var k = 0; k < count; k++) { if(k == 0){ emailDialog.addAttachment(thePhoto1.toImage().media); } else if(k == 1){ emailDialog.addAttachment(thePhoto2.toImage().media); } else if(k == 2){ emailDialog.addAttachment(thePhoto3.toImage().media); } } } else { emailDialog.addAttachment(mainView.toImage()); } emailDialog.addEventListener('complete', function(e) { if (e.result == emailDialog.SENT) { if (Ti.Platform.osname != 'android') { // android doesn't give us useful result codes. // it anyway shows a toast. alert("email sent successfully"); } } else { alert("message was not sent. result = " + e.result); } }); emailDialog.open(); }, 100); } ```

HelloWorld using Alloy is failing to run emulator Nexus

0
0

Here is the message I get: DEBUG] : map: "build\map\Resources\android\alloy\controllers\index.js.map" [TRACE] : [1.25202s] TOTAL [INFO] :
[INFO] : Alloy compiled in 1.25202s [INFO] : Alloy compiler completed successfully [INFO] : Launching emulator: Galaxy Nexus [INFO] : Running: C:\android-sdk-win\tools\emulator.exe "-avd" "Galaxy Nexus" "-port" "5554" "-no-boot-anim" "-partition-size" "128" [DEBUG] : Ignoring C:\development\Titanium_Studio_Workspace\HelloWorld1\Resources\android [DEBUG] : Ignoring C:\development\Titanium_Studio_Workspace\HelloWorld1\Resources\mobileweb [ERROR] Application Installer abnormal process termination. Process exit value was 1

ti info in the console gives me the following: Titanium Command-Line Interface, CLI version 3.2.1, Titanium SDK version 3.2.2.GA Copyright (c) 2012-2014, Appcelerator, Inc. All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

Operating System Name = Microsoft Windows 8.1 Version = 6.3.9600 Architecture = 32bit # CPUs = 4 Memory = 7.9GB

Node.js Node.js Version = 0.10.13 npm Version = 1.3.2

Titanium CLI CLI Version = 3.2.1 node-appc Version = 0.2.0

Titanium SDKs 3.2.2.GA Install Location = C:\Users\kcrismon\AppData\Roaming\Titanium\mobilesdk\win32\3.2.2.GA Platforms = tizen, mobileweb, android, blackberry git Hash = 96e9a07 git Timestamp = 03/05/14 12:21 node-appc Version = 0.2.0

Intelr Hardware Accelerated Execution Manager (HAXM) Not installed

Java Development Kit Version = 1.7.0_11 Java Home = c:\glassfish3\jdk7

Android SDK Android Executable = C:\android-sdk-win\tools\android.bat ADB Executable = C:\android-sdk-win\platform-tools\adb.exe SDK Path = C:\android-sdk-win

Android NDK NDK Path = c:\android-ndk-r9d NDK Version = r9d

Android Platforms 1) android-16 Name = Android 4.1.2 API Level = 16 Revision = 4 Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs = armeabi-v7a, mips, x86 Path = C:\android-sdk-win\platforms\android-16 2) android-17 Name = Android 4.2.2 API Level = 17 Revision = 2 Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs = armeabi-v7a, mips, x86 Path = C:\android-sdk-win\platforms\android-17 3) android-18 Name = Android 4.3 API Level = 18 Revision = 2 Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in ABIs = armeabi-v7a, x86 Path = C:\android-sdk-win\platforms\android-18 4) android-19 Name = Android 4.4.2 API Level = 19 Revision = 3 Skins = HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800, WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearS quare ABIs = armeabi-v7a, x86 Path = C:\android-sdk-win\platforms\android-19

Android Add-Ons None

Android Emulators Galaxy Nexus Path = undefined SDK Version = undefined ABI = undefined Skin = undefined SD Card = no sd card Google APIs = no

Yet I still get the error referenced above.

Question... Since I am going to be doing iOS as well. SHould I just switch all of this over to my Mac? Is this stable on Windows 8.1?

If so, what seems to be the issue here?

Thanks!

Ken

Window opacity

0
0

Hello!

I am using Titanium 3.1.3, android.

I want to make a view when window background have opacity=0.6(user can see previous page) and in middle of window is my custom optionDialog .

<Window height="Ti.UI.FILL" height="Ti.UI.FILL" opacity="0.6">      
        <View  id="customDialog" backgroundColor="white" height="Ti.UI.SIZE width="Ti.UI.SIZE>
                      //my option dialog
                </View>
</Window>
But opacity have an effect upon my widnow and upon "customDialog". Could someone suggest me the way to cancel opacity for my customDialog view?

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

Viewing all 7655 articles
Browse latest View live




Latest Images