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

Zip files on android

$
0
0

Is it allready possible to zip files in titanium mobile on Android? I use a module for unzipping files on Android and IOS, but for android there does not seem to be anything out there for zipping files. Or do i need to make my own module?


webview with websocket support

$
0
0

Hi all, how integrate websocket support in WebView?

Can we create customized plugin with Titanium SDK?

$
0
0

If I want to create a customized FTP module, can I achieve that goal without paying?(I know there exist free FTP modules, this is just an example I make.) I mean that is creating special plugins for android and iOS platform possible?

how to make a double ended slider ?

$
0
0

Hi, I want to show a simple price range for a search criteria selection screen where user can set min price by left ended ring and max price by right ended ring. There's a Jquery UI slider at http://jqueryui.com/demos/slider/#range which looks kind of what I am trying to implement. can anyone tell me how can i do this ? i want to implement this for both iPhone and android.

How to create panorama view in android and ios ?

Cannot run a sample mobile app with the Titanium Android Emulator

$
0
0

Hi, I'm new using the Titanium IDE, I use the Eclipse environment normally for creating Android Apps.

So after I installed the Titanium IDE (3.2.1.1391541866-7T7848-f6gZIs6MY) in a Windows 8 OS, I configured the paths for the Android SDK installed in order to run the android emulators on the Titanium.

I checked this docs for configuring the Android-SDK in Windows 8:

http://docs.appcelerator.com/titanium/latest/#!/guide/Software_Locations_and_Environment_Variables-section-29004844_SoftwareLocationsandEnvironmentVariables-WindowsSoftwareLocations

http://docs.appcelerator.com/titanium/latest/#!/guide/Installing_Platform_SDKs-section-29004842_InstallingPlatformSDKs-Androidsettings

So after configured the Android SDK, JDK (32 bits) and system variables paths, I tried to run a Mobile App I get the "Run configurations" screen where I am asked to browse a "Keystore Location".

This issue happens everytime I try to run any mobile app on the Android Emulator.

Any thoughts? Thanks.

Custom style for Tab

$
0
0

Hello! I am using Titanium 3.1.3, android, alloy.

I need to make custom style for my tabs. Specifically I need to change "title" textSize, color and "icon" size. Are in Titanium some ways to do that?

Thx Appcelerator - new App released

$
0
0

This is no real question but as a relative active user in this forum I would like to introduce our new app.

GetBuzz - Flirt & Dating App

iOS: http://itunes.apple.com/app/getbuzz-famous-flirt-dating/id810360885?&mt=8

Android: https://play.google.com/store/apps/details?id=com.getbuzz.android

It's no ordinary app that you might see every day. We have spent many months from first basic concept to official release for iOS (2 weeks ago) and for Android (yesterday).

It should also point out what is possible with Appcelerator Titanium. I know some native developers still think that Titanium is a second-rate framework with lack of performance and functionality. Well, I think we can prove that it's in fact possible to create a really high quality app.

The iOS app was launched 2 weeks ago with a bigger marketing campaign and we entered the AppStore charts from zero to Top 15 in Germany overall, with rank 2 in our category "Social Network" just behind WhatsApp. So watch out Tinder, here comes GetBuzz ;)

We have extended the basic Titanium SDK with a dozen custom modules to archieve a UI and UX experience that can compete with "real" native apps. If you have any questions - from view of point as developer - I can share some experiences and best practices. Especially the development for Android was sometimes really hard but we are really happy with the final result.

BTW: this is the 2nd app we made with Appcelerator. The first one has already over 1.5 mio iOS downloads. So thanks again to Appcelerator to provide such an outstanding platform.


Calling toImage() on a view with crashes on Android. How else to you get width/height from an Image?

$
0
0

Is this expected, that toImage() on a view is not supported on Android? According to the API docs (that we all know are half-baked) I didn't see anything that would lead me to believe that you cannot. My attempts to get an image blob on a View or ImageView all end badly. After banging my head a while against this I dug into the KitchenSink app and found an eventual call to toImage guarded by a check for the iPhone platform.

On iPhone, you can create an ImageView from a file and then call toImage to get an image blob on which you can query the width and height. Is there another way? Without such, do we really have to hard-code all our image dimensions to what the anticipated native dimensions of the image are?

Stop ImageView images in a tableview reloading when scrolling out of view and then back into view

$
0
0

When i scroll down the page and then back up, the images that were already loaded into the imageview (from remote url) reload themselves. Is there a way that I can stop this happening and, once the images have loaded, they remain loaded and do not reload?

This is happening on Android

SDK Version: 1.8.2 Android Runtime: Rhino Google APIs Android 2.3.3

Density-based images don't work on buttons & annotations

$
0
0

I am using Titanium 1.7.5 on Android 2.3 on Linux.

Using the instructions at <http://wiki.appcelerator.org/display/guides/Using+density-specific+resources+on+Android> , I added my icons in Resources/android/images/res-mdpi/media/icons/.

I see that all the icons are getting copied to the build/android/res/drawable-mdpi directory correctly. But when I run the app, the icons which were used on buttons & as annotation markers don't show up!

So

> Ti.UI.createButton({image: '/images/media/icons/buttonicon.png'})

results in a transparent button. Similarly

> Ti.Map.createAnnotation({image: '/images/media/icons/marker_pin.png'})

results in a transparent annotation which is clickable, but not visible!

All other density-specific icons used in the app work correctly.

Is there something I am missing here?

Very slow performance with Android/Emulator

$
0
0

Hi,

I have 2 questions about the performance to expect when working with Titanium Studio and the Android emulator. I'm running this on a Linux Box with the latest versions of Oracle JDK, Titanium and Android SDK.

First, preparing/compiling the app and launching it in the Emulator seems to take rather long. I have measured around 45s when doing the same on OS X and the iOS emulator takes 20s on a much less powerful machine.

Second, when running an app (ToDo List demo) in the emulator i constantly get Choreographer infos:

[INFO] :   Choreographer: Skipped 108 frames!  The application may be doing too much work on its main thread.
The app itself is very slow, in the Todo List Demo app showing the "add item" screen takes 1-2s and feels very laggy.

Is this expected behaviour or is something wrong with my setup?

Buttons instead of tabs?

$
0
0

Hi,

I am developing a mobile app both for android and iPhone using Titanium CLI version 3.2.1, Titanium SDK version 3.2.2.GA, Alloy version 1.3.1.

My requirement is that I need to have a face-book style sliding menu along-with tabs. I tried for many days to have the sliding menu along with a Tab Group. I also asked a question on the forum here -

http://developer.appcelerator.com/question/164061/facebook-like-sliding-menu-with-tab-group---both-iphone-and-android

But as I am unable to do so. I am thinking of an alternative of using a view and putting buttons in it to make it act and look like a Tab Group.

<View id="bottomViewContainer">
            <Button id="recommended" class="tabButtons" backgroundImage="/images/tabs/mymood.png" backgroundSelectedImage="/images/tabs/mymoodActive.png" backgroundFocusedImage='/images/tabs/mymoodActive.png' onClick="openRecommended"/>
            <Button id="topPicks" class="tabButtons" onClick="openTopPicks"/>
            <Button id="bestSellers" class="tabButtons" onClick="openBestSeller"/>
            <Button id="trending" class="tabButtons" onClick="openTrending"/>
        </View>
But now I am facing a new problem, I have noticed that in a tab, the last selected tab maintains a pressed or selected state but I am unable to do so using a button.

I have used backgroundSelectedImage and backgroundFocusedImage but I am not getting the same result as on selecting a tab.

How can achieve the same selected effect for the button as the tab? Please advice.

Thanks a lot your time and help.

Access SMS

$
0
0

Hello Experts this is my first day with Titanium and I choosed it to have iOS and Andriod app using the same code but before I start I want to get a confirmation that using Titanium SDK I can access SMS because I am developing an app that access SMS.

Cannot start Android emulator on mac os x

$
0
0

Hi,

I just downloaded Titanium 3 today and I try to start the default projet (just created a new alloy project) on android simulator. But the android emulator didn't start (but iOS work perfectly) and I get this error in the console:

[INFO] : Running: /Users/frp/Library/android-sdk-macosx/tools/emulator "-avd" "Nexus 4" "-port" "5554" "-no-boot-anim" "-partition-size" "128" [ERROR] : Emulator exited with error: 1 [ERROR] : PANIC: Could not open: Nexus 4 [ERROR] Application Installer abnormal process termination. Process exit value was 1

Here is some info about my configuration : - running Titanium on Mac Os X 10.9.2 (macbook air 2013) - installed all 4.X android SDK version - Titanium SDK version 3.2.2.GA - Titanium Studio, build: 3.2.1.201402041146

I've tried to create a AVD, goggleing for 3 hour but i didn't find any relevant resolution

Is it possible to get some help...

It's urgent, I've to made some test in order to select our development platform for mobile apps. If I can't solve this issue, Titanium will be rejecter from our choice

as far than I read, it's a great tool but I've to get some proof of concept and without a working environment, it's not possible


titanium studio con not find android sdk 2.3.3

$
0
0

OS:win7 64bit JDK:1.6 34bit Titanium studio version:3.1.2 Titanium sdk version:3.2.1 description: My titanium always connot find android sdk and it warn me "•An Android SDK is missing. Titanium requires Android platform: 2.3.3 or above." and when I try to change the android sdk path in "window->preferences->studio->platforms->android" an error will appear->"the currently displayed page contains invalid values"and the "apply button" and "OK button" connot be press.I am sure the android sdk path is right and i have already download the android sdk 2.3.3

Switch Checkbox style dont'see on Android app

$
0
0

I create a Switch with Ti.UI.Android.SWITCH_STYLE_CHECKBOX , but I don't see the square. If I tap in the right position appears the sign of check (see image)

no checked

checked

The code is this, is a new project:

var self = Ti.UI.createView();  
 
    var cmdSwitch = Ti.UI.createSwitch({
        top: "500dp",
        left: "30dp",
        color: "#000",
        borderColor: "#000",
        title: "<-- checkbox here!?!?",
        style: Ti.UI.Android.SWITCH_STYLE_CHECKBOX  
 
    });
 
    self.add(cmdSwitch);
Can you help me?

Thank's!

Roberto Sitzia

What to do about error Getting GCM SenderId failed on Android?

$
0
0

Hi! Im trying to use GCM with Titanium Studio, and I wanna be able to implement Push Notification in my Android App: Im using the code bellow:

`var win = Ti.UI.createWindow({ layout: 'vertical', backgroundColor: 'white' });

var CloudPush = require('ti.cloudpush'); CloudPush.addEventListener('callback', function (evt) { alert(evt.payload); }); CloudPush.addEventListener('trayClickLaunchedApp', function (evt) { Ti.API.info('Tray Click Launched App (app was not running)'); }); CloudPush.addEventListener('trayClickFocusedApp', function (evt) { Ti.API.info('Tray Click Focused App (app was already running)'); });

/* * Create a label to show Push type */ var pushTypeLabel = Ti.UI.createLabel({ top: '10dp', width: '320dp', height: '25dp', textAlign: 'center', font: { fontSize:14}, color: 'black', text: 'Push Type: ' + CloudPush.pushType }); win.add(pushTypeLabel);

/* * Create a label to show device token on screen */ var deviceTokenLabel = Ti.UI.createLabel({ top: '10dp', width: '320dp', height: (CloudPush.pushType=='gcm'?'150dp':'40dp'), font: { fontSize:14}, color: 'black', text: 'Device Token' }); win.add(deviceTokenLabel);

CloudPush.retrieveDeviceToken({ success: deviceTokenSuccess, error: deviceTokenError });

function deviceTokenSuccess(e) { Ti.API.info('Device Token: ' + e.deviceToken); deviceTokenLabel.text = 'Device Token:' + e.deviceToken; enablePush.enabled = true; }

function deviceTokenError(e) { alert('Failed to register for push! ' + e.error); deviceTokenLabel.text = 'Failed to get device token.'; }

/* Push can be enabled or disabled. */ var enablePush = Ti.UI.createButton({ top: '10dp', width: '320dp', height: '40dp', enabled: false }); enablePush.addEventListener('click', function () { enablePush.title = CloudPush.enabled ? 'Disabling...' : 'Enabling...'; CloudPush.enabled = !CloudPush.enabled; // NOTE: Push.enabled takes a moment to update after you change its value. setTimeout(syncButtons, 500); }); win.add(enablePush);

/* Whether or not to show a tray notification. */ var showTrayNotification = Ti.UI.createButton({ top: '10dp', width: '320dp', height: '40dp' }); showTrayNotification.addEventListener('click', function () { CloudPush.showTrayNotification = !CloudPush.showTrayNotification; syncButtons(); }); win.add(showTrayNotification);

/* Whether or not clicking a tray notification focuses the app. */ var showAppOnTrayClick = Ti.UI.createButton({ top: '10dp', width: '320dp', height: '40dp' }); showAppOnTrayClick.addEventListener('click', function () { CloudPush.showAppOnTrayClick = !CloudPush.showAppOnTrayClick; syncButtons(); }); win.add(showAppOnTrayClick);

/* Whether or not tray notifications are shown when the app is in the foreground. */ var showTrayNotificationsWhenFocused = Ti.UI.createButton({ top: '10dp', width: '320dp', height: '40dp' }); showTrayNotificationsWhenFocused.addEventListener('click', function () { CloudPush.showTrayNotificationsWhenFocused = !CloudPush.showTrayNotificationsWhenFocused; syncButtons(); }); win.add(showTrayNotificationsWhenFocused);

/* Whether or not receiving a push immediately brings the application to the foreground. */ var focusAppOnPush = Ti.UI.createButton({ top: '10dp', width: '320dp', height: '40dp' }); focusAppOnPush.addEventListener('click', function () { CloudPush.focusAppOnPush = !CloudPush.focusAppOnPush; syncButtons(); }); win.add(focusAppOnPush);

/* Trigger callbacks together or one by one when multiple push notifications come. */ var singleCallback = Ti.UI.createButton({ top: '10dp', width: '320dp', height: '40dp' }); singleCallback.addEventListener('click', function () { CloudPush.singleCallback = !CloudPush.singleCallback; syncButtons(); }); win.add(singleCallback);

function syncButtons() { enablePush.title = CloudPush.enabled ? 'Push Enabled' : 'Push Disabled'; showAppOnTrayClick.title = CloudPush.showAppOnTrayClick ? 'Tray Click Shows App' : 'Tray Click Does Nothing'; showTrayNotification.title = CloudPush.showTrayNotification ? 'Show in Tray' : 'Do Not Show in Tray'; focusAppOnPush.title = CloudPush.focusAppOnPush ? 'Push Focuses App' : 'Push Doesn\'t Focus App'; showTrayNotificationsWhenFocused.title = CloudPush.showTrayNotificationsWhenFocused ? 'Show Trays when Focused' : 'Hide Trays when Focused'; singleCallback.title = CloudPush.singleCallback ? 'Callbacks trigger one by one' : 'Callbacks trigger together'; }

syncButtons(); win.open();`

When I run the code I get error: Failed to register for push notifications! Failed receiving GCM SenderId, Getting GCM SenderId failed. Max retry time reaches. Error two: Failed to get device token.

What can I do to resolve this error I get?

Image resize and orientation fix issue

$
0
0

Hi I am working on a app that have functionality to pick images from camera and display those images as thumbnails. In Order to avoid memory strain I am resizing the Big image into small size like 100x100.

But the issue is the image picked from camera is 90 rotated to which I need to fix . I tried using "autorotate :true" it worked fine with the original image but with re-sized image its not working . I saved the re-sized image as file in app directory . But it loosing the Orientation meta data I think . Can you please help me to get out of this issue...

Thanks Sudheer

Using Canvas with Titantium

$
0
0

Hi, i am developing a very simple application which uses javascript to time the amount of time it takes to render vector graphics onto a canvas. I want to test the application across a mobile browser, phonegap and the chrome mobile API and also titanium. I am not sure how it would be possible with titanium? i am sure it must be but i cannot find a definitive answer or guide on how it can be done.

<!DOCTYPE html>
<html>
<head>
<script type="application/javascript" language="javascript">
window.onload = draw;
 
function draw() {
 var before_loadtime = new Date().getTime();
 var loops=1000;
 for (i=0; i<loops; i++) {
 drawit(); }
         var aftr_loadtime = new Date().getTime();
         pgloadtime = (aftr_loadtime - before_loadtime) / 1000;
         document.getElementById("loadtime").innerHTML = "Page load time is <font color='red'><b>" + pgloadtime/loops + "</b></font> Seconds";
}         
  // put into a loop
  function drawit() {
    var canvas = document.getElementById("canvas1");
    var ctx = canvas.getContext("2d"); 
    ctx.beginPath();
    ctx.moveTo(0,400);
    ctx.lineTo (10,400);
    ctx.lineTo (10,0);
    ctx.lineTo (20,0);
    ctx.lineTo (20,400);
    ctx.fill();
    ctx.closePath();
}
</script>
</head>
<body>
<canvas id="canvas1" width="400" height="400"></canvas>
<h3 style="font-weight: bold; font-style: italic; font-size: large; color: #3333CC">Page load time in JavaScript</h3>
<div>
<span id="loadtime"></span>
</div>
</body>  
</html>
That is a short version of one element of the application, there are 5 other options (polygons, squares etc) which can be drawn by clicking buttons.

Cheers for any help, Alex

Viewing all 7655 articles
Browse latest View live




Latest Images