Monday, April 29, 2019

Social share for android

Sample code


========
 var share_body = "https://play.google.com/store/apps/details?id=motiur_bdresult.bd.com.bdresult";
        var share_subject = "Please download it from the below link";

        var intent = Ti.Android.createIntent({
            action: Ti.Android.ACTION_SEND,
            type: "text/plain"
        });

        intent.putExtra(Ti.Android.EXTRA_SUBJECT, share_subject);
        intent.putExtra(Ti.Android.EXTRA_TEXT, share_body);
        intent.addCategory(Ti.Android.CATEGORY_DEFAULT);
        Ti.Android.currentActivity.startActivity(intent);

========

Hope this help.

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!