How to access a remote php file from ANDROID?
For working on the localhost use 10.0.2.2 and for remote use the IP or domain name of the server. The following code does this.
For working on the localhost use 10.0.2.2 and for remote use the IP or domain name of the server. The following code does this.
This is the main Java file that extends activity. Create a file named ScreenON_OFF_ACTIVITY.java and place the below code in it. This is the class that extends the Broadcast receiver class that receives the notifications. create a java file and name it ScreenReceiver.java and place the following code in it. This the class that updates… Read More »
The following is a sample code to do this. Simply copy and paste.
AIR treats the XML files as just as normal file and so you can proceed using the FileStream classs. Please take a look at the sample code. Just copy and paste the following code to your main.MXML file and you are done. Please post your comments on this post
This sample shows how to add a menu to your context menu or the right click of your menu in Adobe AIR. AIR Uses the ContextMenu class to add menu to your mouse right click. import flash.events.ContextMenuEvent; import mx.controls.Alert; // call this function to create context menu in AIR and FLex private function createContextMenu():void {… Read More »
There are two files the following is the code in the main mxml file. Please make another file named Itemcombo.mxml and place it in the same directory as the main MXML file. Itemcombo.mxml Item1 Item2 Item3 Item4 main.xml
In the following code the navigateToURL property is navigating to the same page which creates the refreshing of the page.
The code below does this . Simply copy and paste the following code.. applicationComplete=”init()”> Alert { color : #124332; background-color: #ffffff; header-colors : #243322, #243322; header-height:19; drop-shadow-enabled: true; drop-shadow-color :#243322; corner-radius :10; border-style :solid; border-thickness: 1; border-color : #243322; footer-colors : #243322, #ffffff; title-style-name : “title”; } .myalertstyle { backgroundAlpha: 0.3; backgroundColor: black; borderAlpha: 0.3;… Read More »
The following code helps you to do this. Save the following code as am .mxml file The html file start.html
The following code helps you to do this. It uses the “setStyle” property of the window to change it’s background style. The following code changes the background color of the window to black on a button click. Just copy and paste the following code. Call this function on the click of a button This code… Read More »
You often may need scrolling backgrounds in your game or any other application. The following code helps you to add continuous backgrounds. Each sprite is added to the right of the current sprite which make them continuos. //Add more stripes, flip them, and position them next to their neighbour stripe. for (int i = 0;… Read More »
//Dynamically change the sprite image…… //my_sprite is a CCSprite already initialized with spriteWithFile. [[CCTextureCache sharedTextureCache] removeTexture:[self.my_sprite texture]; CCTexture2D *tex = [[CCTextureCache sharedTextureCache] addImage:@”new_image.jpg”]; [my_sprite setTexture:tex];
The CCRibbon class, together with touch input, can be used to create the line-drawing effects of popular games. Note: you can’t remove individual points from a CCRibbon. You can only remove the whole CCRibbon by removing it as child from its parent.
CCBitmapFontAtlas faster than CCLabel. Labels that update fast at the expense of more memory usage, like any other CCSprite,is the specialty of the CCBitmapFontAtlas class //Usage… CCBitmapFontAtlas scoreLabel = [CCBitmapFontAtlas bitmapFontAtlasWithString:@”0″ fntFile:@”bitmapfont.fnt”];
Basic file operations Assumes the existence of a file called “testfile” in the current working directory #import #import #import #import #import int main (int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString *fName = @”testfile”; NSFileManager *fm; NSDictionary *attr; // Need to create an instance of the file manager fm =… Read More »
#import “ViewController.h” @implementation ViewController @synthesize mlabel; – (void)viewDidLoad { [super viewDidLoad]; arrayNo = [[NSMutableArray alloc] init]; [arrayNo addObject:@” Hello “]; [arrayNo addObject:@” Hai “]; [arrayNo addObject:@” Picker “]; [arrayNo addObject:@” Simple “]; [arrayNo addObject:@” example “]; [pickerView selectRow:1 inComponent:0 animated:NO]; mlabel.text= [arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]]; } – (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView; { return 1; } – (void)pickerView:(UIPickerView *)pickerView… Read More »
Hold the windows key and press M. This will minimise all windows in one key press! This is the same as pressing the ‘Show Desktop’ icon but without having to click on it. It should be noted that Windows key + D also works for this!
The temp folder found in C:WindowsTemp often contains files that have no reason to exist any longer. You can use the ‘Disk Cleanup Wizard’ that comes with windows to sort out your temp folder by clicking on the Start menu -> Programs -> Accessories -> System Tools -> Disk Cleanup. Select the drive you wish… Read More »
You can create endlessly looping animations this way. This code lets a node rotate forever like an endlessly spinning wheel:
— First thing you need to do is to start command prompt or CMD. There is two ways: Press F8 when Windows XP start up (before windows xp logo – progress bar for loading) and choose “Save Mode Command prompt” option If you are logged in: click on start -> Run, type “cmd” and press… Read More »
This code will set your ringtone for ANDROID. To set a ringtone you have to add it to the database. otherwise it will not be set also gives no error also. Insert it into the database
XSLT uses XPath to find information in an XML document. XPath is used to navigate through elements and attributes in XML documents.
This code snippet captures audio from a given source and saves it to a file with android.media.MediaRecorder.
CSS = Style Sheets for HTML HTML uses predefined tags, and the meaning of each tag is well understood. The table tag in HTML defines a table – and a browser knows how to display it. XSL = Style Sheets for XML XML does not use predefined tags (we can use any tag-names we like),… Read More »
The WifiManager can be used to enable and disable wifi. Where ‘enabled’ is a boolean.