Android Development Environment Setup for Windows 8

Setting the Android Development Environment is very simple and explained step by step in android.com web site, But these steps lacks some information. 

This site says that if you download the “ADT Bundle for Windows” you will have everything to start the development process. But if you do so then the first error you will get that eclipse will not run if your PC is freshly windows installed or no JVM installed in your PC. 

So, you need to download and install “jdk-7u21-windows-x64 .exe“. 

After That if you need to run your android application in Samsung Android Phone, Then you are in big trouble, because Samsung kies have no driver version yet for windows8. So, if you install kies, it will not install the driver for the phone and you will not able to browse your phone or can not debug your software in you device.

What you need to do is download latest version of kies and install it.

after installation go to “C:\Program Files (x86)\Samsung\Kies\USB Driver” 

Right click on “SAMSUNG_USB_Driver_for_Mobile_Phones.exe” -> “Properties” -> “Compatibility” -> Check “Run this program in compatibility mode for:” -> choose “Windows 7”

Now install the USB driver again. 

 

Now it will work fine. Thank you for reading this article. 🙂

Quick Start: Unicode Support for C++ Application

This is a quick start guidance :

Here I will provide very simple example about how we can develop C++ application to support UNICODE characters.

Here some generic purpose function and data type name listed with example, which can be used with both Unicode and non-Unicode characters based on the project settings.  If _UNICODE is defined in project settings then these generic function and data types will automatically convert to defined types.

1. Use “CString” instead of using “String”

e.g.

String testString = “Hello World”;        [Do not use]

CString testString = _T(Hello World);  [Need to use]

 

2. Use “TCHAR” instead of using “char” or “wchar_t

e.g.

char testChar = ‘H’;               [Do not use]

TCHAR testChar = _T(‘H’);   [Need to use]

 

3. Use “_T()” while writing string literals

e.g.

char testString [] = “Hello World”; [Do not use]

TCHAR testString[] = _T(“Hello World”); [Need to use]

 

4. Use Generic Text Routine Mapping [http://msdn.microsoft.com/en-us/library/tsbaswba(v=vs.80).aspx] instead of using specific functions and data types.

e.g. use “_tcscpy” instead of using strcpy

 

Robotics in Bangladesh

I am writing this post as I have faced some trouble to find shop to buy parts i.e. In system programmer, IC, and other electronics parts which are needed to build initial robotic program.

This post is for the student or any interested person who is interested to study and willing to work on robotics from the very beginning. You will get some basic information regarding where you can buy these parts in Dhaka, Bangladesh and build initial circuit and program simple function in to the micro-controller and and run it.

This post is some kind of running HELLO WORLD application from shopping robotics parts in Bangladesh to blink a led using those parts.

TO-DO:

Basic Tutorial:

Place to Buy Parts:

Basic Parts to Buy:

Basic Software to Use:

 

Thank you for reading this post.

Game Engine Development :

Working on game engine development …

Goal : to develop some game engine to be familiar with the different part of AI and magic or Object oriented programming.

Source code will be available to download.

My first developed AI engine for Mancala board game.

Source Download link: https://sourceforge.net/projects/aimancala/

VmWare Death : “This virtual machine appears to be in use”

Go to the Vmware folder and Delete all *.lck files … and enjoy

 

 

Design Pattern Series 2 : Decorator Pattern

Decorator Pattern:

  • Closed for Modification, Open for Extension.
  • Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

WIP …

Design Pattern Series 1 : Strategy Pattern

Strategy Pattern:

  • Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
  • All the algorithm will be independently and will share a common Base class.
  • There will be a “has-a” relationship between the implementing and algorithm base class.
  • There will be a Strategy set method or Custom constructor to set the strategy algorithm that will be used by the implementing class.

WIP …

ATM Machine : Open Source Project Development

This project has the functionality of a Complete Automated Teller Machine (ATM). Features like,

  • User Management
  • Money Exchange Management
  • Report Generation, etc.

Work in progress …

Set pthread Thread Priority


struct sched_param sched_param;
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + THREAD_PRIORITY_VALUE;
if(pthread_setschedparam(pthread_self(), SCHED_FIFO, &sched_param) != 0)
{
   printf("Failed \n");
}

 

 

Ubuntu Natty : install desktop from command line

Commands to install Ubuntu desktop GUI from console.

sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo dpkg-reconfigure xserver-xorg
sudo /etc/init.d/gdm start

Change the vmware workstation menu to english

Rename “Program Files\VMware\VMware Workstation\messages\ja” to any other name. Yaapeeeeeeeeeeeeeeee

enum in C – ERROR: Resource Path Location

Error : Resource Path Location Type expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before

If you use this, you will get an compilation error.


enum ERROR_CODE
{
 ERROR_CODE_FAILED = 0,
 ERROR_CODE_SUCCESS,
};

ERROR_CODE hal_dalEmmaInitialize(void);

Fix is given below

</code>

tyopedef enum
 {
 ERROR_CODE_FAILED = 0,
 ERROR_CODE_SUCCESS,
 }ERROR_CODE;

ERROR_CODE hal_dalEmmaInitialize(void);

BADA could not find symbol index F3

sometime Bada IDE fails to find symbol index giving an error like “Could not find symbol index …”

this problem can be easily solved by rebuilding the symbol index for the project.

to do that  ->

Right click on project -> select “Index” -> then select “Rebuild”

Enjoy ….

Posted in BADA. 1 Comment »

OpenSSL Public Key Cryptography

OpenSSL Shell commands

1. Generate Private key.

$openssl  genrsa  -out private.pem  1024

2. Extract Public key from Private key

$openssl rsa -in private.pem -pubout -out  public.pem

3. Sign using Private key [Encrypting using Private key]

$ openssl rsautl -sign -in file1.txt -inkey private.pem -out sig.txt

4. Verify using Public key [Decrypting using Public key]

$openssl rsautl -verify -in sig.txt -inkey public.pem -pubin -out sig2.txt

5. Encrypt using Public key

$openssl rsautl  -encrypt -inkey public.pem  -pubin -in file1.txt -out  file2.txt

6. Decrypt using Private key

$openssl rsautl  -decrypt -inkey private.pem  -in file2.txt -out  file3.txt

7. Create Message Digest

$openssl dgst -sign private.pem -out file.sign file1.txt

8. Verify Message Digest

$openssl dgst -verify public.pem -signature file.sign file1.txt

Run Shell Command in Perl

$result=`any_shell_command`;

$result = qx/any_shell_command/;

system("any_shell_command");


QT Error: switch case jump to case label

Put braces around case functionality.

This code will give error : jump to case label

 </code>

switch((MESSAGE_TYPE)lMessageType)
 {
case CHECK_RES:

QString lMessageCheckResponse = getMessageFromCheckResponse(aMessage);

QString lSignatureCheckResponse =  getSignatureFromCheckReponse(aMessage);

break;

default:
break;
 }

<code>

This is the solution :

 </code>

switch((MESSAGE_TYPE)lMessageType)
 {
 case CHECK_RES:
 {
 QString lMessageCheckResponse = getMessageFromCheckResponse(aMessage);

 QString lSignatureCheckResponse =  getSignatureFromCheckReponse(aMessage);

 break;
 }

 default:
 break;
 }

<code>

Convert from Int to QString

QString::number(int)

Video Tutorials for many subjects

Quotes of the Day

12/03/2010:

Failure does not mean you are a failure,
It does mean you haven’t succeeded yet.

Failure does not mean you have accomplished nothing,
It does mean you have learned something.

Failure does not mean you have been a fool,
It does mean you have had lots of faith.

Failure does not mean you don’t have it,
It does mean you have to do it in a different way.

Failure does not mean you are inferior,
It does mean you have a reason to start afresh.

Failure does not mean you should give up,
It does mean you must try harder.

Failure does not mean you will never make it,
It does mean it will take a little longer.

Failure does not mean GOD has abandoned you,
It does mean GOD has a better idea….

======================================

26-01-2010 : I’ll try being nicer if you try being smarter

C# TreeView – CheckBox – Double Click – BUG – for VISTA and Win7

This bug arises in Vista and Win7 whenever you double click on the TreeView item checkbox. Double click will not fire any even but it will change the check status of that item which leads to inconsistent behavior of TreeView item checking.

Solution : use this  NewTreeView class instead of TreeView default class.


using System;
using System.Windows.Forms;

public class NewTreeView : TreeView {
protected override void WndProc(ref Message m) {
 if (m.Msg == 0x203) { m.Result = IntPtr.Zero; }
 else base.WndProc(ref m);
 }
}

Happy New Year….

Wish you all a very Happy New Year : 2010

Protected: Helpful site for Vocabulary study

This content is password protected. To view it please enter your password below:

Posted in Uncategorized. Enter your password to view comments.

Word Book Bug List

Please submit if you get any functional or UI related bug by sending email to anandopaul@gmail.com or post a comment . Version 0.1

  1. In word view sentence is coming before word meaning.
  2. Speak is not working.
  3. After Inserting a word, can not add, remove or change the picture related to it.
  4. If I do not want to add any Antonyms or Synonyms to word list then that Antonyms or Synonyms word is not inserting into the word list but it is also not inserting into Antonyms or Synonyms list.
  5. If I left the Image file path blank then Image for previous Inserted Image is adding with the new word.
  6. Word Edit is not working.

keep a post always as the first one

while updating or creating new post if you want to show the blog always in front page then

goto “Edit” “Visibility” -> select “Public” and then check “Stick this post to the front page”

Now Publish or Update

C# : play Mp3 files

Add reference of windows media player  “WMPLib”

Steps :

1. Right click on project and Add Reference

2. Select COM tab

3. Then Find and Add Windows Media Player (WMPLib ) .

now In Code :


WMPLib.WindowsMediaPlayer WinMediaPlayer = new

WMPLib.WindowsMediaPlayer();

WinMediaPlayer.URL = @"C:\a\abandon.wav";

WinMediaPlayer.controls.play();

Next post I will some other control for media player….


class Player
 {
 private static Player mPlayer;

 WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();

 string FilePath = @"C:\Documents and Settings\";

 public Player()
 {
 }

 public void SetFilePath(string aFileName)
 {
 wplayer.URL = FilePath + aFileName;
 }

 public void play()
 {
 wplayer.controls.play();
 }

 public void stop()
 {
 wplayer.controls.stop();
 }

 public void pause()
 {
 wplayer.controls.pause();
 }

 public static Player pPlayer
 {
 get
 {
 if (mPlayer == null)
 {
 mPlayer = new Player();
 }
 return mPlayer;
 }
 }

 }

Mainform Maximize by Default on Load Time

Open Properties of Mainform then set the property of WindowState to Maximized.

Fastest Create File List in C#

Fastest file list creation in C# using core C. This process is helpful to build fast application for file manipulation using C#, as default file manipulation function api’s of C# are very slow.

NOTE : copy and paste code will not work, this code have some dependencies, Here I just given the logic and prototype of the algorithm.

</pre>
[DllImport("Kernel32.dll", CharSet = CharSet.Auto)]
public static extern FindFirstFile(String fileName, [In, Out] FindData findFileData);

public void FindAllFiles(string aFilePath)
{
FindData findData = new FindData();

SafeFindHandle handle = FindFirstFile(aFilePath + @"\*", findData);

if (EventProgress != null)
{
EventProgress();
}

if (!handle.IsInvalid)
{
try
{
do
{
if (findData.fileName.Equals(@".") || findData.fileName.Equals(@".."))
{
continue;
}

string lFilePath = aFilePath + @"\" + findData.fileName;

if ((findData.fileAttributes & (int)FileAttributes.System) != 0 || (findData.fileAttributes & (int)FileAttributes.ReadOnly) != 0)
{
continue;
}

if ((findData.fileAttributes & (int)FileAttributes.Directory) != 0 && (findData.fileAttributes & (int)FileAttributes.Hidden) == 0)
{
FindAllFiles(lFilePath);
}
else if ((findData.fileAttributes & (int)FileAttributes.Directory) == 0)
{
FileList lFileInfo = new FileList();

lFileInfo.FileName = findData.fileName;
lFileInfo.FileFullPath = aFilePath + @"\";
lFileInfo.FileTime = CovertFileTime(findData);
lFileInfo.FileSize = ConvertFileSize(findData);

DriveFileList.Add(lFileInfo);

}

} while (FindNextFile(handle, findData));
}
catch(System.Threading.ThreadAbortException)
{

}
catch (System.Exception e)
{
System.Windows.Forms.MessageBox.Show("Exception : 6 " + e.Message);
}
}
}

Send Free Sms in Bangladesh

Enjoy UNLIMITED 100% free sms to Bangladesh and Worldwide….

FREE SMS LINK

Upload Files to share

if you want to upload rar or zip files then http://www.box.net is a good site to upload files and give the link in you post as there is no facilities in word-press to upload rar or zip files. Hope it will help you.

www.box.net

Account Type : Free

Total Space : 1 GB

Max File Size : 25 MB

Mobile Software programming

if u have some basic idea about programming then you can develop your own java games or software for your mobile using NetBean 6 .

for this you need to have two software to download,

1. Netbean 6 – http://www.netbeans.org/downloads

2. Java SDK 6 – http://java.sun.com/javase/downloads/index.jsp

Developing mobile software using these software then Deploy them into your mobile is really interesting… download them , install it and use it… if you have any problem then pls inform me. I will try to make it out…

Disappear / Hide start menu, Desktop Icons Beacuse of Virus or Spyware

If you are facing such types of problem like start menu bar and Desktop Icons has been disappeared and you are not able to run your any program from your PC. Here I am giving you the solutions for that.

🙂 This problem is because of spy wares like Trojan.
🙂 If this Trojan attacks you then you can not use your start menu or any desktop icons. There is only one way ( From my point of view or you can say because of lack of research I found this solution) to use your programs. TO DO that , Press ( CTRL + ALT + DEL) key , then Task manager will appear.

Then click

File -> New Task (Run …) -> Browse ( select the program you want to use)

potentially you can use most of the program but you can not use My Computer. If you explorer then automatically it will be close only.

Now come to the point that how to solve this problem. JUST NOW I GOT RELIEF from this problem.

DOWNLOAD SUPERAntiSpyware from http://www.superantispyware.com/download.html
download the free edition , its free and works fine.

then Install it . TO install it you need to follow the previous techniques that I have give early by using CTRL + ALT + DEL -> File -> New Task -> Browse to the download folder and select the setup file. it will be installed in your PC after you press ok. After installing it will ask for update the virus definition. Update it. without updating the definition it may not work properly.

Then when now the problem is how you can RUN the installed program. To Do that …

CTRL + ALT + DEL -> File -> New Task -> Browse -> right click and click Explore .

In this time for 20 to 30 second the start menu will be visible then you run the program form the start menu … be sure to do it fast. and then scan the whole computer and after scanning select all the spyware that has be detected and clear it. Restart is needed to

…………. IF THIS process not work in your computer then Install another copy of Windows OS in another drive and download , install , update and scan the system with the SUPERAntySpyware .

Fastest Iterative BST Traversal


lpFileList = Head;

if ( lpFileList != NULL )
{
while( lpFileList->Smaller != NULL )
{
lpFileList = lpFileList->Smaller;
}

do
{

// write anything for each node

***before any continue statement u must call this function
//lpFileList = ddrv_getFile( lpFileList );

//To Get next file
if ( lpFileList->Bigger != NULL )
{
lpFileList = lpFileList->Bigger;
while( lpFileList->Smaller != NULL )
{
lpFileList = lpFileList->Smaller;
}
}
else
{
while( lpFileList->Parent != NULL && lpFileList == lpFileList->Parent->Bigger )
{
lpFileList = lpFileList->Parent;
}
lpFileList = lpFileList->Parent;
}
}while ( lpFileList != NULL );
}

DEFRAGFILE * ddrv_getFile( DEFRAGFILE * apFileList )
{
if ( apFileList == NULL )
{
return NULL;
}

if ( apFileList->Bigger != NULL )
{
apFileList = apFileList->Bigger;
while( apFileList->Smaller != NULL )
{
apFileList = apFileList->Smaller;
}
}
else
{
while( apFileList->Parent != NULL && apFileList == apFileList->Parent->Bigger )
{
apFileList = apFileList->Parent;
}
apFileList = apFileList->Parent;
}

return apFileList;

}

Move File Cluster in Kernel Mode Driver (Fastest Method)

This API call sequence is the fastest process to move file segment from one cluster to another cluster for low lever file management.


NTSTATUS ddrv_MoveFileBlock( SPEED_DEVICE_EXTENSION* apDevExt, HANDLE ahFile, ULONGLONG aullStartVcn, ULONGLONG aullTargetLcn, ULONGLONG aullClusters )
{
ULONG lulStatus;
IO_STATUS_BLOCK lIoStatusBlock;

if( KeReadStateEvent( &apDevExt->mStopEvent ) == 0x1 )
{
ddrv_exitDefrag( apDevExt , 1 );
return STATUS_ABANDONED;
}

apDevExt->mpMoveFile->FileHandle = ahFile;
apDevExt->mpMoveFile->StartVcn.QuadPart = aullStartVcn;
apDevExt->mpMoveFile->TargetLcn.QuadPart = aullTargetLcn;

#ifdef _WIN64
apDevExt->mpMoveFile->NumVcns = aullClusters;
#else
apDevExt->mpMoveFile->NumVcns = ( ULONG )aullClusters;
#endif

lulStatus = ZwFsControlFile( apDevExt->mhVolume, NULL, NULL, 0, &lIoStatusBlock, FSCTL_MOVE_FILE, apDevExt->mpMoveFile, sizeof( MOVEFILE_DESCRIPTOR ), NULL, 0 );

if( lulStatus == STATUS_PENDING )
{
NtWaitForSingleObject( ahFile, FALSE, NULL );
lulStatus = lIoStatusBlock.Status;
}

if ( lulStatus != STATUS_SUCCESS )
{
DebugPrint("Move Unsuccessful : %x", ( UINT )lulStatus );
DebugPrint(" aullStartVcn %I64u aullTargetLcn %I64u mTotalClusters %I64u", aullStartVcn, aullTargetLcn, apDevExt->mTotalClusters );
}

return lulStatus;
}

Create Doubly Linked list from singly Linked List

BOOLEAN ddrv_CreateDoublyLinkedList( SPEED_DEVICE_EXTENSION * apDevExt )
{
DEFRAGFILE * lpFileList = apDevExt->mpFileList;
DEFRAGFILE * lpPrevFile = NULL;

if ( lpFileList != NULL )
{
lpFileList->mPrevPtr = NULL;
lpPrevFile = lpFileList;
lpFileList = lpFileList->mNextPtr;
}

while( lpFileList != NULL )
{
lpFileList->mPrevPtr = lpPrevFile;
lpPrevFile = lpFileList;
lpFileList = lpFileList->mNextPtr;
}

send Exe file by mail…

all we fetch a big problem while we need to send a software or any small game to our friends by mail even after renaming the file name. so here is the easy solution for this problem.

1. download and install winrar.

2. right click on that file or folder and select “Add to archive”

3. then select “Advanced” tab and click “Set Password” button

4. Then check “Encrypt file  names” option and select ok twice.

your problem is solved. send the rar file.

Text to Speech

  1. Right click on project
  2. Add Reference
  3. select COM tab
  4. select “Microsoft Speech Object Library” and click ok.
  5. In code : add library “using SpeechLib;”
  6. In function :
    SpVoice voice = new SpVoice();
    voice.Speak(“Hello world”, SpeechVoiceSpeakFlags.SVSFlagsAsync);

Create Free Expert Exchange User Account

Click this link to get an free expert exchange sites free account.

Free Register

BREW client Example code

before running this client you need to run a server which will listen to a port and give server’s IP address in client code

INET_PTON( AEE_AF_INET, “192.168.18.169”/*your server IP*/, &a );

any problem contact me, if you need then i can send you a sample server code. Hope this post is useful for you.


#include "AEEModGen.h"          // Module interface definitions.
#include "AEEAppGen.h"          // Applet interface definitions.
#include "AEEShell.h"           // Shell interface definitions.
#include "AEENet.h"
#include "AEENetworkTypes.h"

#include "DebugTestClient.bid"
#include "DebugTestClient_res.h"

#define SERVER_PORT 8888

typedef struct _DebugTestClient {
 AEEApplet  applet;    // First element of this structure must be AEEApplet.
 IDisplay * piDisplay; // Copy of IDisplay Interface pointer for easy access.
 IShell   * piShell;   // Copy of IShell Interface pointer for easy access.
 AEEDeviceInfo  deviceInfo; // Copy of device info for easy access.
 // Add your own variables here...

 INetMgr		*pNetMgr;
 ISocket		*pSocket;
 INAddr		ipAddrr;

} DebugTestClient;

void DebugTestClient_FreeAppData(DebugTestClient * pMe)
{
 // Insert your code here for freeing any resources you have allocated...

 // Example to use for releasing each interface:
 // if ( NULL != pMe->piMenuCtl ) {     // check for NULL first
 //     IMenuCtl_Release(pMe->piMenuCtl)// release the interface
 //     pMe->piMenuCtl = NULL;          // set to NULL so no problems later
 // }
 //

 DebugTestClient	*app = (DebugTestClient*)pMe;

 DBGPRINTF("In debugtest_FreeAppData 1");

 if(app->pSocket)
 {
 ISOCKET_Close(app->pSocket);
 ISOCKET_Release(app->pSocket);
 }

 if(app->pNetMgr)
 {
 INETMGR_Release(app->pNetMgr);
 }
}

static void SendDataCB( DebugTestClient * pMe )
{
 byte * info = "HelloWorld";

 if( AEE_NET_WOULDBLOCK == ISOCKET_Write( pMe->pSocket, info, sizeof(info) ) )
 {
 ISOCKET_Writeable( pMe->pSocket, (PFNNOTIFY)SendDataCB, pMe );
 }
}

static void ConnectionMade(DebugTestClient *pMe, int error)
{
 //check error code
 byte * info = "HelloWorld";

 switch(error)
 {
 case AEE_NET_ETIMEDOUT:
 //connection timed out
 break;
 case AEE_NET_SUCCESS:
 //send some data
 if(AEE_NET_WOULDBLOCK == ISOCKET_Write( pMe->pSocket, info, sizeof( info ) ) )
 {
 ISOCKET_Writeable( pMe->pSocket, (PFNNOTIFY)SendDataCB, pMe );
 }
 break;
 default:
 // some other error
 break;
 }
}

static boolean DebugTestClient_HandleEvent(DebugTestClient* pMe,
 AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
 boolean	ret_val = FALSE;
 INAddr a;
 int err;
 int retVal;

 switch (eCode)
 {
 // Event to inform app to start, so start-up code is here:
 case EVT_APP_START:
 // DebugTestClient_DrawScreen(pMe); // Draw text on display screen.

 retVal = ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_NET,(void**)&pMe->pNetMgr);

 if(pMe->pNetMgr)
 {
 DBGPRINTF("In debugtest_HandleEvent 4");

 pMe->pSocket = INETMGR_OpenSocket(pMe->pNetMgr,AEE_SOCK_STREAM);

 if ( pMe->pSocket == NULL )
 {
 DBGPRINTF("Open Socket Error %x", INETMGR_GetLastError( pMe->pNetMgr ) );
 return FALSE;
 }
 else
 {
 DBGPRINTF("open socket success");
 }
 INET_PTON( AEE_AF_INET, "192.168.18.169",&a );

 ISOCKET_Connect( pMe->pSocket,a/*2836572352*/, HTONS(SERVER_PORT), (PFNCONNECTCB)ConnectionMade, pMe );
 }

 return(TRUE);
 }
}

BREW Resource Manager crashes

if Brew resource manager is crashing then you just reinstall .Net Framework 3.5 service pack 1, your problem will be solved.

If you face any other crashing related problem then post here.

How to write a good technical paper ?

This links gives you some information about how to write a good technical paper which helps your paper to get selected.

Click here to open to document :