This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* I use this method to get contents of JSON formatted file that I put into res | |
* directory to deliver default data for my application. | |
* Visit my blog at http://web.durianapp.com | |
*/ | |
public static String getResFileContent(String filename) { | |
InputStream is = null; | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* To use this example, you need to grap my repository on | |
* https://github.com/amrishodiq/Blackberry-Development-Tutorial/tree/master/TakingPicture/src/com/durianberry/takingpicture | |
*/ | |
public final class TakingPictureScreen extends MainScreen implements | |
PictureTakerListener, FieldChangeListener { | |
private ButtonField button; | |
private BitmapField photoField; | |
public TakingPictureScreen() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static synchronized String saveToFile(String basePath, byte[] data) | |
throws IOException { | |
try { | |
if (basePath.startsWith("file://")) { | |
// do nothing | |
} else if (!basePath.startsWith("/")) | |
basePath = "file:///" + basePath; | |
else if (basePath.startsWith("//")) | |
basePath = "file:/" + basePath; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Method to get all bytes from a file. | |
* | |
* @param path | |
* @return | |
* @throws IOException | |
*/ | |
public static byte[] getFileContent(String path) throws IOException { | |
FileConnection file = null; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void deleteFile(String path) { | |
if (path.startsWith("file://")) { | |
// do nothing | |
} else if (!path.startsWith("/")) | |
path = "file:///" + path; | |
else if (path.startsWith("//")) | |
path = "file:/" + path; | |
else | |
path = "file://" + path; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.durianapp.tutorial; | |
/** | |
* @author amrishodiq | |
*/ | |
public class SingletonClass { | |
// inilah variable yang menyimpan satu-satunya instance class SingletonClass | |
private static SingletonClass instance; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.application({ | |
name: 'App', | |
launch: function() | |
{ | |
alert("Yaa. Akhirnya jalan juga."); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.application({ | |
name: 'App', | |
launch: function() | |
{ | |
Ext.create("Ext.TabPanel", { | |
fullscreen: true, | |
items: [ | |
{ | |
title: 'Home', | |
iconCls: 'home', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.application({ | |
name: 'App', | |
launch: function() | |
{ | |
Ext.create("Ext.TabPanel", { | |
fullscreen: true, | |
tabBarPosition: 'bottom', | |
items: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.application({ | |
name: 'App', | |
launch: function() | |
{ | |
Ext.create("Ext.TabPanel", { | |
fullscreen: true, | |
tabBarPosition: 'bottom', | |
items: [ | |
{ |
OlderNewer