Tuesday, March 19, 2019

Thursday, January 24, 2019

Monday, January 14, 2019

Friday, November 2, 2018

Appc is not recognized as an internal or external command

Try the following steps.

1.  uninstalled appcelerator (npm uninstall -g appcelerator).

2. Then uninstalled Node.

3. Also, delete any node directory to make sure any traces of Node was removed.

4. Reinstall Node - https://nodejs.org/en/#download

5. Reinstall appcelerator (npm install -g appcelerator)
6. Run - appc use latest -l trace

7. Run - appc setup -l trace


Hope this helps.

Tuesday, June 5, 2018

How to change action bar hamburger icon color.

You have to use a custom theme for changing the hamburger icon color. Here is the sample code and doc link

- https://gist.github.com/MotiurRahman/419344fbf8e9d4fb2aa262a4b9054743

- https://docs.appcelerator.com/platform/latest/#!/guide/Android_Action_Bar

Hope this helps.

Wednesday, April 4, 2018

Hyperloop: Example code for checking the notification is enabled or not.

After adding hyperloop module run the following sample code

////////

var Activity = require('android.app.Activity');
var activity = new Activity(Ti.Android.currentActivity);
var contextValue = activity.getApplicationContext();

var notification = require('android.support.v4.app.NotificationManagerCompat');

var notificationObject = notification.from(contextValue);


function doClick(e) {
alert(notificationObject.areNotificationsEnabled());

}

////

Thanks!

Friday, March 9, 2018

How to choose a pdf/doc/image file from the device and upload to the server.

You can try with the following sample code


var window = Ti.UI.createWindow({
backgroundColor : 'red',
layout : "vertical"
});
// Create a Button.
var request = Ti.UI.createButton({
title : 'GO',
height : 100,
width : 100,
backgroundImage : "motiur.jpg",
top : 50
});
request.addEventListener('click', function(e) {
var intent = Ti.Android.createIntent({
action : Ti.Android.ACTION_GET_CONTENT,
type : "application/pdf"

});
intent.addCategory(Ti.Android.CATEGORY_OPENABLE);
var x = Ti.Android.createIntentChooser(intent, "Select");
window.getActivity().startActivityForResult(x, function(e) {

//alert("fileData:" + JSON.parse(e.intent.data));
var doc = Ti.Filesystem.getFile(e.intent.data);
Ti.API.info(JSON.stringify(doc));

var file = Ti.Filesystem.getFile(doc.nativePath);
Ti.API.info("File:" + doc.nativePath);
alert("File path:" + doc.nativePath);

// write here http code for file uploading to the server.

});
});
window.add(request);
window.open();

Thanks!