Showing posts with label Android Module. Show all posts
Showing posts with label Android Module. Show all posts

Sunday, 11 August 2013

Pinterest Module for Photo sharing - Titanium

Hi.

Recently I have developed new titanium module for photo sharing in "Pinterest". This module helps you to sharing images in pinterest. Currently this module only for android.

Download module from here Pinterest - Android Module

Pinterest Module

Description

This module is used to share the photos in pinterest from titanium.

Accessing the pinterest-android Module

To access this module from JavaScript, you would do the following:
var pinterest = require("learnappcelerator.pinterest");
The pinterest variable is a reference to the Module object.

setClientId("clientId");

This is an required Field. You should login into developer.pinterest.com and register you appname. you can get client ID.

pinterest.setClientId("xxxxxxx"); //replace with your client ID

setDebugMode(flag);

This property is optional. If you want to get error logs in console set this as true.
pinterest.setDebugMode(true);

pinterest.createPinterest()

This method used to create the pinIt button.

Usage

var pinterest = require("learnappcelerator.pinterest");
pinterest.setClientId("xxxxxxx");
pinterest.setDebugMode(true);
var pin1 = pinterest.createPin({
        width: 150,
        height: 90,
        top: 100,
        left: 150,
        imageUrl:"http://placekitten.com/400/300",
        baseUrl:"http://placekitten.com",
        description:"kitten image!"
});
win.add(pin1);

Author

Author Name : M. Prakash
Email : prakashmca.m@gmail.com
Blog : http://www.learnappcelerator.blogspot.com

Screen shots:




Thanks.

Monday, 24 June 2013

Garbage Collector - Titanium Module for Android


Recently I developed an native module called Garbage Collector Module and published in Appcelerator Marketplace.


This module is used to Monitor your android device heap memory and force the garbage collector for free the unused objects.

Using this module we can get following informations,
  • MaxVMHeapSize
  • NativeHeapSize
  • VMHeapSize
  • TotalHeapSize
  • VMAllocatedHeapSize
  • NativeHeapAllocatedSize
  • VMHeapTotalAllocatedSize
  •  VMHeapFreeMemory
  • VMHeapTotalFreeMemory
And Also we have two more public methods called,
  • isOutOfMemoryException()   - we can check the Memory exception before app get crash.
  • callGC() - This method force the garbage collector and release the memory occupied by unused objects.
 Accessing the Garbage Collector Module

To access this module from JavaScript, you would do the following:

var garbagecollector = require("prakash.garbagecollector");

Force Garbage Collector

garbagecollector.callGC(); 

Check MemoryException

garbagecollector.isOutOfMemoryException();  returns true/false

Check Heap Memory Status
garbagecollector.getMaxVMHeapSize();
garbagecollector.getNativeHeapSize();
garbagecollector.getVMHeapSize();
garbagecollector.getTotalHeapSize();
garbagecollector.getVMAllocatedHeapSize();
garbagecollector.getNativeHeapAllocatedSize();
garbagecollector.getVMHeapTotalAllocatedSize();
garbagecollector.getVMHeapFreeMemory();
garbagecollector.getVMHeapTotalFreeMemory(); 

Sample App Screenshot
Module URL :

https://marketplace.appcelerator.com/apps/5834?2036618235