Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

how to display data which is coming from server on emulator,
pls can u just give me an idea,the data expected is stock updates and its related map....
im sure dat request is understood by server,im stuck in reading dat data and printing on emulator.....

Assuming that your data returning from the Server is HTML, you can use the IHTMLVIEWER class. Check out the roadwarrior example.

Assuming that your data returning from the Server is HTML, you can use the IHTMLVIEWER class. Check out the roadwarrior example.

gbrown wrote:Assuming that your data returning from the Server is HTML, you can use the IHTMLVIEWER class. Check out the roadwarrior example.
hi thanks for replying,
i got dat, now the problem is how to display a graph coming from server through socket as a response on emulator

gbrown wrote:Assuming that your data returning from the Server is HTML, you can use the IHTMLVIEWER class. Check out the roadwarrior example.
hi thanks for replying,
i got dat, now the problem is how to display a graph coming from server through socket as a response on emulator

I am not sure what do u mean by 'on emulator'. It should be same on handset as well on emulator.
If you are sending the bitmap, then use API that takes bitmap like IBitmap, convertbitmap, IDISPLAY_BitBlt etc.,

I am not sure what do u mean by 'on emulator'. It should be same on handset as well on emulator.
If you are sending the bitmap, then use API that takes bitmap like IBitmap, convertbitmap, IDISPLAY_BitBlt etc.,

bru wrote:I am not sure what do u mean by 'on emulator'. It should be same on handset as well on emulator.
If you are sending the bitmap, then use API that takes bitmap like IBitmap, convertbitmap, IDISPLAY_BitBlt etc.,
expected response from server is stock updates and respective graph of it,
but when i display it(using menuctl) on screen only textual stock update data is coming but not image, i have no idea of image.............
how can i display both..........

bru wrote:I am not sure what do u mean by 'on emulator'. It should be same on handset as well on emulator.
If you are sending the bitmap, then use API that takes bitmap like IBitmap, convertbitmap, IDISPLAY_BitBlt etc.,
expected response from server is stock updates and respective graph of it,
but when i display it(using menuctl) on screen only textual stock update data is coming but not image, i have no idea of image.............
how can i display both..........

mk.manju wrote:expected response from server is stock updates and respective graph of it,
but when i display it(using menuctl) on screen only textual stock update data is coming but not image, i have no idea of image.............
how can i display both..........
i will explain my problem from begining so it may help u to give response
we are doing a project to fetch data from various stock exchanges,
we are using socket for connection and we are able to show the latest updates from the stock exchange on our screen, but inaddition to that its respective graph updates need to be displayed. in one write request response is coming for both string as wellas graph, but we are able to display only string, how to differentiate between image data and string

mk.manju wrote:expected response from server is stock updates and respective graph of it,
but when i display it(using menuctl) on screen only textual stock update data is coming but not image, i have no idea of image.............
how can i display both..........
i will explain my problem from begining so it may help u to give response
we are doing a project to fetch data from various stock exchanges,
we are using socket for connection and we are able to show the latest updates from the stock exchange on our screen, but inaddition to that its respective graph updates need to be displayed. in one write request response is coming for both string as wellas graph, but we are able to display only string, how to differentiate between image data and string

if i understand it correctly this is what you need is to chang a stream of bytes to image.
try to use the following interface :IMemAStream
this will change the bytes in to Stream then use
IIMAGE_SetStream to Create the IImage
note : this will only work if you send the actual bytes of the image but if you use some kind of encoding on the server side (like Base64) you will need to decode first then use the interface

if i understand it correctly this is what you need is to chang a stream of bytes to image.
try to use the following interface :IMemAStream
this will change the bytes in to Stream then use
IIMAGE_SetStream to Create the IImage
note : this will only work if you send the actual bytes of the image but if you use some kind of encoding on the server side (like Base64) you will need to decode first then use the interface

abd_cie wrote:if i understand it correctly this is what you need is to chang a stream of bytes to image.
try to use the following interface :IMemAStream
this will change the bytes in to Stream then use
IIMAGE_SetStream to Create the IImage
note : this will only work if you send the actual bytes of the image but if you use some kind of encoding on the server side (like Base64) you will need to decode first then use the interface
thanks
i understood,but nw i came to know dat initially server response is only string after 5-10 sec image is generated from server, when i try to read data after 5-10sec time it goes to wouldblock, how to read data from socket for second time,
i used ishellsettimer and called read but nothing worked

abd_cie wrote:if i understand it correctly this is what you need is to chang a stream of bytes to image.
try to use the following interface :IMemAStream
this will change the bytes in to Stream then use
IIMAGE_SetStream to Create the IImage
note : this will only work if you send the actual bytes of the image but if you use some kind of encoding on the server side (like Base64) you will need to decode first then use the interface
thanks
i understood,but nw i came to know dat initially server response is only string after 5-10 sec image is generated from server, when i try to read data after 5-10sec time it goes to wouldblock, how to read data from socket for second time,
i used ishellsettimer and called read but nothing worked

Manju,
The response should come after creating the image, So wait at the server itself till you get the image and send the response.

Manju,
The response should come after creating the image, So wait at the server itself till you get the image and send the response.

bru wrote:Manju,
The response should come after creating the image, So wait at the server itself till you get the image and send the response.
im not able to understand how to wait at the server,pls if u can help,
how to wait at server till response is available

bru wrote:Manju,
The response should come after creating the image, So wait at the server itself till you get the image and send the response.
im not able to understand how to wait at the server,pls if u can help,
how to wait at server till response is available

am a little lost Brother
are u asking about the images or the sockets and how to use there interface?
if you are asking how to handle Would_Block if u got it
then it is easy :
use the function
ISOCKET_Readable(ISocket * pISocket, PFNNOTIFY pfn, void * pUser)
where pfn is the name of function called when there is a new Data.
let me put it this way :
most of the BREW sockets interface functions are non Blocking
this mean that when u read a big data coming from the server this data might have a delay till it reach so the BREW continue the execution.
by using this function what u are telling the BREW is that when the data come please call this function (i usually call the same function and in it i check how much data left to be read and append it to a buffer )
for more information and a good example refer to the book :
Wireless Game Development in C/C++ with BREW (Chapter 17)
good luck

am a little lost Brother
are u asking about the images or the sockets and how to use there interface?
if you are asking how to handle Would_Block if u got it
then it is easy :
use the function
ISOCKET_Readable(ISocket * pISocket, PFNNOTIFY pfn, void * pUser)
where pfn is the name of function called when there is a new Data.
let me put it this way :
most of the BREW sockets interface functions are non Blocking
this mean that when u read a big data coming from the server this data might have a delay till it reach so the BREW continue the execution.
by using this function what u are telling the BREW is that when the data come please call this function (i usually call the same function and in it i check how much data left to be read and append it to a buffer )
for more information and a good example refer to the book :
Wireless Game Development in C/C++ with BREW (Chapter 17)
good luck

Hi Experts,
Can any one tell me how to display web page (or actually google map) on the screen.

Hi Experts,
Can any one tell me how to display web page (or actually google map) on the screen.

abd_cie wrote:am a little lost Brother
are u asking about the images or the sockets and how to use there interface?
if you are asking how to handle Would_Block if u got it
then it is easy :
use the function
ISOCKET_Readable(ISocket * pISocket, PFNNOTIFY pfn, void * pUser)
where pfn is the name of function called when there is a new Data.
let me put it this way :
most of the BREW sockets interface functions are non Blocking
this mean that when u read a big data coming from the server this data might have a delay till it reach so the BREW continue the execution.
by using this function what u are telling the BREW is that when the data come please call this function (i usually call the same function and in it i check how much data left to be read and append it to a buffer )
for more information and a good example refer to the book :
Wireless Game Development in C/C++ with BREW (Chapter 17)
good luck
hello abd
im using isocket redable but im not able to fetch da image, which is send by da server after 10 sec,do u have any idea, even im using ishellsettimer by calling isocketread function time to time.

abd_cie wrote:am a little lost Brother
are u asking about the images or the sockets and how to use there interface?
if you are asking how to handle Would_Block if u got it
then it is easy :
use the function
ISOCKET_Readable(ISocket * pISocket, PFNNOTIFY pfn, void * pUser)
where pfn is the name of function called when there is a new Data.
let me put it this way :
most of the BREW sockets interface functions are non Blocking
this mean that when u read a big data coming from the server this data might have a delay till it reach so the BREW continue the execution.
by using this function what u are telling the BREW is that when the data come please call this function (i usually call the same function and in it i check how much data left to be read and append it to a buffer )
for more information and a good example refer to the book :
Wireless Game Development in C/C++ with BREW (Chapter 17)
good luck
hello abd
im using isocket redable but im not able to fetch da image, which is send by da server after 10 sec,do u have any idea, even im using ishellsettimer by calling isocketread function time to time.

hi
can u be more specific with the problem .
a question
was u able to create a connection and successfully send any data at all (i am not talking about the image i am talking about sending any simple data between your client and server like sending a byte )?
also try to post some of the non working code here so we might help u with it .
thanks.

hi
can u be more specific with the problem .
a question
was u able to create a connection and successfully send any data at all (i am not talking about the image i am talking about sending any simple data between your client and server like sending a byte )?
also try to post some of the non working code here so we might help u with it .
thanks.

Ashutosh,
When you prepare the text data, you should not be responding back to client. Instead, when you said, the server is preparing image after 10sec., so start that process after the text then get the image. Finally post it back to client.

Ashutosh,
When you prepare the text data, you should not be responding back to client. Instead, when you said, the server is preparing image after 10sec., so start that process after the text then get the image. Finally post it back to client.

abd_cie wrote:hi
can u be more specific with the problem .
a question
was u able to create a connection and successfully send any data at all (i am not talking about the image i am talking about sending any simple data between your client and server like sending a byte )?
also try to post some of the non working code here so we might help u with it .
thanks.
abd,
bru
im able to create connection and get response from server,
also im able to display server response on the screen. the response is stock
update but the query is after some time the respective graph of this stock update is generated by server(10 sec), tat im not able to read it again....
dat is da problem,
we are using same read function for reading text as well as image.....
the code which we tried to read
boolean Socket_ReadMove(MitickerApp * pApp)
{
int nRet,nRet1;
int i;
unsigned char temp[500] = {0};
pApp->nNetstate = NETSTATE_READ;
//Cancel callback and read data from server
ISOCKET_Readable(pApp->pISocket, NULL, NULL);
nRet = ISOCKET_Read(pApp->pISocket, temp, sizeof(char) * 500);
if(nRet>NULL)
{
File_fun(pApp,temp);//trying to write into file also
display_output(pApp,temp);//to display on screen
/*the code used to call read after some time but we dint get any data*/
ISHELL_SetTimer(pApp->a.m_pIShell,10000,
(PFNNOTIFY)Socket_ReadMove, pApp);
}
if (nRet == AEE_NET_ERROR)
{
int nErr = ISOCKET_GetLastError(pApp->pISocket);
ISHELL_CloseApplet(pApp->a.m_pIShell, FALSE);
return FALSE;
}
if (nRet == AEE_NET_WOULDBLOCK)
{
//If this call blocks, assign callback
ISOCKET_Readable(pApp->pISocket, Socket_ReadCallBack, (void*)pApp);
}
}

abd_cie wrote:hi
can u be more specific with the problem .
a question
was u able to create a connection and successfully send any data at all (i am not talking about the image i am talking about sending any simple data between your client and server like sending a byte )?
also try to post some of the non working code here so we might help u with it .
thanks.
abd,
bru
im able to create connection and get response from server,
also im able to display server response on the screen. the response is stock
update but the query is after some time the respective graph of this stock update is generated by server(10 sec), tat im not able to read it again....
dat is da problem,
we are using same read function for reading text as well as image.....
the code which we tried to read
boolean Socket_ReadMove(MitickerApp * pApp)
{
int nRet,nRet1;
int i;
unsigned char temp[500] = {0};
pApp->nNetstate = NETSTATE_READ;
//Cancel callback and read data from server
ISOCKET_Readable(pApp->pISocket, NULL, NULL);
nRet = ISOCKET_Read(pApp->pISocket, temp, sizeof(char) * 500);
if(nRet>NULL)
{
File_fun(pApp,temp);//trying to write into file also
display_output(pApp,temp);//to display on screen
/*the code used to call read after some time but we dint get any data*/
ISHELL_SetTimer(pApp->a.m_pIShell,10000,
(PFNNOTIFY)Socket_ReadMove, pApp);
}
if (nRet == AEE_NET_ERROR)
{
int nErr = ISOCKET_GetLastError(pApp->pISocket);
ISHELL_CloseApplet(pApp->a.m_pIShell, FALSE);
return FALSE;
}
if (nRet == AEE_NET_WOULDBLOCK)
{
//If this call blocks, assign callback
ISOCKET_Readable(pApp->pISocket, Socket_ReadCallBack, (void*)pApp);
}
}

hi
please check the following thread(the last post contains a code)
http://brewforums.qualcomm.com/showthread.php?p=55765#post55765
in that thread i posted a way and a simple example code how to handle login and then receiving an image.
after reading that thread u can read the following comment .
comment :if want to update your info every 10 seconds make the client do the polling not the server(this mean that the Client is the one keep asking for info every 10 seconds and the server response with the info)
the flow could be something like this :
1-Client send a command (request refreshed data ) the same way in the thread i gave u link to .
2-the server sends the data
3-Client reads the data.
4-Client send an image command to get the image (use another function other than the one for the text)
5-the server sends the image
6-Client reads the image.
7-the Client do the processing (like saving it to a file)
7-client sleep for 10 seconds and then request the info again(do this using timers)
making the client send the requests gives you more control over your application and gives you the chance to send other requests for the server(like sending a command that will get other kind of data)
it is not recommended to make the server do that polling.

hi
please check the following thread(the last post contains a code)
http://brewforums.qualcomm.com/showthread.php?p=55765#post55765
in that thread i posted a way and a simple example code how to handle login and then receiving an image.
after reading that thread u can read the following comment .
comment :if want to update your info every 10 seconds make the client do the polling not the server(this mean that the Client is the one keep asking for info every 10 seconds and the server response with the info)
the flow could be something like this :
1-Client send a command (request refreshed data ) the same way in the thread i gave u link to .
2-the server sends the data
3-Client reads the data.
4-Client send an image command to get the image (use another function other than the one for the text)
5-the server sends the image
6-Client reads the image.
7-the Client do the processing (like saving it to a file)
7-client sleep for 10 seconds and then request the info again(do this using timers)
making the client send the requests gives you more control over your application and gives you the chance to send other requests for the server(like sending a command that will get other kind of data)
it is not recommended to make the server do that polling.

Now I understand that you dont have any control on server side and all you do is requesting the URL given to you for both text and image. So if you know some approx time to receive the image, then have a timer set in BREW code, mean while you should have got the image. Now the timer would have expired and display both txt and img.

Now I understand that you dont have any control on server side and all you do is requesting the URL given to you for both text and image. So if you know some approx time to receive the image, then have a timer set in BREW code, mean while you should have got the image. Now the timer would have expired and display both txt and img.

Also this link tells how to embed inline image(incase if you dont know).
http://brewforums.qualcomm.com/showthread.php?t=13496

Also this link tells how to embed inline image(incase if you dont know).
http://brewforums.qualcomm.com/showthread.php?t=13496