|
|
|
In android, how can I access files from any path that is not included in the .apk file.
I am making an application that reads the data from .xml file. Now this file can be updated from the server, and new data should be shown to the user.
but i am not able to access the file when its not in the apk.
help will be much appreciated.
|
|
|
|
|
|
are you using phonegap application?
|
|
|
|
|
no, i am making a software in C.
|
|
|
|
|
Hi all friends
I am developing an application on vxWorks and target board is ML507. My application receives data in loop from PC through a socket. If I set the "Default socket receive buffer size" to 48000, net speed is 210 mbps and worked normally. If I set it to 200000 in start the speed is very low and after a few seconds the network is hanged?
Where is the problem? What is the best value for "Default socket receive buffer size"?
I searched the web but did not get the result.
Thanks for your help.
|
|
|
|
|
A_Fa wrote: What is the best value for "Default socket receive buffer size"? If you mean Default, there's only one value. And you didn't mention details about code, language, etc.,
From Google search I found the value is 8192. Socket.ReceiveBufferSize Property[^]
And I think your question is not related to Mobile development(Based on my Google search). Clickety[^]. If it's a 3rd party component then ask the vendor for help, they could resolve the issue quickly.
|
|
|
|
|
This is a very info page.I am very much interested this post.Every body
should read this post.so This a great post.Thank you for posting.
[URL="http://www.faketexts.com "]mobile message tips[/URL]
|
|
|
|
|
You have to show piece of code to understand in detail!!
|
|
|
|
|
Hello to everybody!
This is my final year at university for computer science!
Can anybode help me with any idea about FINAL YEAR PROJECT!
Thanks in advance!
|
|
|
|
|
|
Kindly let us know your skills and the standard of studies of your institute.
|
|
|
|
|
Well I graduated in 2008 and my final year project was based on Steganography and Cryptography. I might have that project somewhere but I am sure there must have been lot of development in this field since then. If you want to extend that project, I am happy to share that project on Git Hub but you will have to ask your tutors first.
|
|
|
|
|
Can you please let us know for which technology are you talking about??
|
|
|
|
|
Could you give me a code?
Thank you!
EMAIL ; 30715981@qq.com
|
|
|
|
|
|
|
|
HAHAHAHAHAHAHA! Here ->
// giveMeACode.cs
public class giveMeACode
{
public static void Main()
{
System.Console.WriteLine("Here is a PROTRACTOR!");
}
}
|
|
|
|
|
I'm working on win ce 6 modbus tcp client server, application is developed for a client server communication and it is working fine. now req is my slave device should respond to the diff slave addresses polled by master/client. Can I just change slave id and establish connection or I need to close previous connection and again establish new one
below is the code, which is working fine for one node, if I polled with other node ID then it gives exception. what change it req to communicate with other node simultaneously. My device should be able to communicate with 32 diff nodes on modbus tcp. Shall I create individual threads for each node but how they will communicate on same port? before establishing connection with other node shall I close previous node?
startupServer(int slaveAddr, const TCHAR * const hostName)
{
int result;
int tcpOption;
struct sockaddr_in hostAddress;
if (isStarted())
return (FTALK_ILLEGAL_STATE_ERROR);
if ((slaveAddr < -1) || (slaveAddr > 255))
return (FTALK_ILLEGAL_ARGUMENT_ERROR);
this->slaveAddr = slaveAddr;
#ifdef _WINSOCKAPI_
WSADATA wsaData;
result = WSAStartup(0x0101, &wsaData);
if (result != 0)
return (FTALK_SOCKET_LIB_ERROR);
#endif
listenSocket = socket(PF_INET, SOCK_STREAM, 0);
if (listenSocket == INVALID_SOCKET)
{
shutdownServer();
return (FTALK_OPEN_ERR);
}
#ifdef SO_REUSEADDR
tcpOption = 1; setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR,
(char *) &tcpOption, sizeof (tcpOption));
#endif
hostAddress.sin_family = AF_INET;
if ((hostName == NULL) || (hostName[0] == '\0'))
hostAddress.sin_addr.s_addr = htonl(INADDR_ANY);
else
{
hostAddress.sin_addr.s_addr = inet_addr((char *) hostName);
#if !defined(__VXWORKS__) // We don't support host name resolving with VxWorks
if (hostAddress.sin_addr.s_addr == INADDR_NONE)
{
struct hostent *hostInfo;
hostInfo = gethostbyname((char *) hostName);
if (hostInfo == NULL)
return (FTALK_TCPIP_CONNECT_ERR);
hostAddress.sin_addr = *(struct in_addr *) hostInfo->h_addr;
}
#endif
}
hostAddress.sin_port = htons(portNo);
result = bind(listenSocket, (struct sockaddr *) &hostAddress,
sizeof (hostAddress));
if (result == SOCKET_ERROR)
{
shutdownServer();
switch (socketErrno)
{
#ifdef _WINSOCKAPI_
case WSAEACCES:
return (FTALK_PORT_NO_ACCESS);
case WSAEADDRINUSE:
return (FTALK_PORT_ALREADY_BOUND);
case WSAEADDRNOTAVAIL:
default:
return (FTALK_PORT_NOT_AVAIL);
#else
case ENOTCONN: case EACCES:
return (FTALK_PORT_NO_ACCESS);
case EADDRINUSE:
return (FTALK_PORT_ALREADY_BOUND);
case EADDRNOTAVAIL:
default:
return (FTALK_PORT_NOT_AVAIL);
#endif
}
}
result = listen(listenSocket,
((MAX_CONNECTIONS < SOMAXCONN) ? MAX_CONNECTIONS : SOMAXCONN));
if (result == SOCKET_ERROR)
{
shutdownServer();
return (FTALK_LISTEN_FAILED);
}
return (FTALK_SUCCESS);
}
serverLoop()
{
int iReturnCode = (FTALK_SUCCESS);
int result;
int sockIdx;
int recvResult;
int sendResult;
fd_set fdSet;
timeval timeVal;
SOCKET maxFileDes;
int replyCnt;
int tcpOption;
if (!isStarted())
return (FTALK_ILLEGAL_STATE_ERROR);
FD_ZERO (&fdSet);
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4127)
#endif
FD_SET (listenSocket, &fdSet);
#ifdef _MSC_VER
# pragma warning(pop)
#endif
maxFileDes = listenSocket;
for (sockIdx = 0; sockIdx < MAX_CONNECTIONS; sockIdx++)
{
if (connectionSocketArr[sockIdx] != INVALID_SOCKET)
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4127)
#endif
FD_SET (connectionSocketArr[sockIdx], &fdSet);
#ifdef _MSC_VER
# pragma warning(pop)
#endif
if (connectionSocketArr[sockIdx] > maxFileDes)
maxFileDes = connectionSocketArr[sockIdx];
}
timeVal.tv_sec = (long) timeOut / 1000L;
timeVal.tv_usec = ((long) timeOut % 1000L) * 1000L;
if (timeOut == 0)
result = select((int) maxFileDes + 1, &fdSet, NULL, NULL, NULL);
else
result = select((int) maxFileDes + 1, &fdSet, NULL, NULL, &timeVal);
if (result == SOCKET_ERROR)
return (FTALK_FILEDES_EXCEEDED);
if (result == 0)
{
TRACELOG1("Slave poll time-out!\n");
dataTablePtr->timeOutHandler();
iReturnCode = (FTALK_REPLY_TIMEOUT_ERROR);
}
if (FD_ISSET (listenSocket, &fdSet))
{
for (sockIdx = 0; sockIdx < MAX_CONNECTIONS; sockIdx++)
{
if (connectionSocketArr[sockIdx] == INVALID_SOCKET)
{
struct sockaddr_in peerAddr;
SOCK_LEN_TYPE peerAddrLen = sizeof(peerAddr);
connectionSocketArr[sockIdx] = accept(listenSocket,
(struct sockaddr *) &peerAddr,
&peerAddrLen);
if (connectionSocketArr[sockIdx] != INVALID_SOCKET)
{
if (!dataTablePtr->validateMasterIpAddr(inet_ntoa(peerAddr.sin_addr)))
{
shutdown(connectionSocketArr[sockIdx], SD_BOTH);
closesocket(connectionSocketArr[sockIdx]);
connectionSocketArr[sockIdx] = INVALID_SOCKET;
TRACELOG2("Connection rejected on slot %d\n", sockIdx);
}
#ifdef TCP_NODELAY
tcpOption = 1; setsockopt(connectionSocketArr[sockIdx],
IPPROTO_TCP, TCP_NODELAY,
(char *) &tcpOption, sizeof (tcpOption));
#endif
#ifdef SO_SNDBUF
tcpOption = MAX_MSG_SIZE;
setsockopt(connectionSocketArr[sockIdx],
SOL_SOCKET, SO_SNDBUF,
(char *) &tcpOption, sizeof (tcpOption));
#endif
#ifdef SO_RCVBUF
tcpOption = MAX_MSG_SIZE;
setsockopt(connectionSocketArr[sockIdx],
SOL_SOCKET, SO_RCVBUF,
(char *) &tcpOption, sizeof (tcpOption));
#endif
#ifdef SO_LINGER
tcpOption = 0; setsockopt(connectionSocketArr[sockIdx],
SOL_SOCKET, SO_LINGER,
(char *) &tcpOption, sizeof (tcpOption));
#endif
TRACELOG2("Connection accepted on slot %d\n", sockIdx);
}
break; }
}
}
for (sockIdx = 0; sockIdx < MAX_CONNECTIONS; sockIdx++)
{
if (connectionSocketArr[sockIdx] != INVALID_SOCKET)
{
if (FD_ISSET (connectionSocketArr[sockIdx], &fdSet))
{
recvResult = recv (connectionSocketArr[sockIdx],
(char *) bufferArr, sizeof (bufferArr), 0);
sendResult = 0;
replyCnt = 0;
if (recvResult >= PREFIX_LEN) {
short dataLen;
dataLen = (short) ((bufferArr[4] << 8) | (bufferArr[5] & 0xFF));
if ((dataLen + PREFIX_LEN) == recvResult)
{
replyCnt = processMessage(&bufferArr[PREFIX_LEN],
recvResult - PREFIX_LEN);
bufferArr[2] = 0; bufferArr[3] = 0; bufferArr[4] = (char) ((replyCnt) >> 8);
bufferArr[5] = (char) ((replyCnt) & 0xFF);
sendResult = send(connectionSocketArr[sockIdx],
(char *) bufferArr,
replyCnt + PREFIX_LEN, 0);
}
}
if ((recvResult < PREFIX_LEN) ||
(sendResult != replyCnt + PREFIX_LEN))
{
shutdown(connectionSocketArr[sockIdx], SD_BOTH);
closesocket(connectionSocketArr[sockIdx]);
connectionSocketArr[sockIdx] = INVALID_SOCKET;
if (recvResult == 0)
TRACELOG2("Disconnected slot %d nicely by other peer.\n",
sockIdx);
else
TRACELOG2("Forced disconnection on slot %d!\n", sockIdx);
}
}
}
}
return iReturnCode;
}
|
|
|
|
|
You already posted this in the C++ forum. Please do not crosspost.
Veni, vidi, abiit domum
|
|
|
|
|
please try to post minimum code to get higher chance for getting answer from the experts, because on one has time to read your thousands lines of code.
|
|
|
|
|
Hi. I have problem in my NORDICID windows CE 6.0/-handheld-/. When i reboot the device, i lose my files. So every time i reboot the device i need to transfer the app, again, that i'm developing, to the handheld and to reconfigure the wifi(because the password of the network reconfigured is lost too).
How can i keep the files and the wifi password after rebooting?
Any help?
modified 5-Feb-14 5:49am.
|
|
|
|
|
Hello. I have an an application on a handheld that reads rfid and stores the result in a txt file. all good so far. i read thefile in order to save it into sql server. but i am having a big error.
Here is my code. Is there anything wrong with it?
The error is in the comment. because it's a long error.
Public Function ChangeFormat(ByVal dtm As String) As Date
Dim temp As String = ""
temp = Mid(dtm, 4, 2) & "/"
temp = temp & Mid(dtm, 1, 2) & "/"
temp = temp & Mid(dtm, 7, 4) & " "
temp = temp & Mid(dtm, 12)
ChangeFormat = CDate(temp)
End Function
Private Sub cmdimport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdimport.Click
Try
If connect2008() = True Then
If MsgBox("Do you want to export data to server?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim _cmd As New SqlCommand("", connchip)
Dim i As Integer = 0
Dim strsql2 As String = ""
Dim tmp As String = ""
Dim ln() As String
Dim f As New System.IO.StreamReader("\ticketpro\export\" & Format(Now, "yyyyMMdd") & "HH.txt")
While Not f.EndOfStream
tmp = f.ReadLine
ln = tmp.Split(",")
strsql2 = "insert into handheld ("
strsql2 = strsql2 & "dat, "
strsql2 = strsql2 & "ticketnum, "
strsql2 = strsql2 & "stationid, "
strsql2 = strsql2 & "hhid, "
strsql2 = strsql2 & "status) values ("
strsql2 = strsql2 & "'" & ChangeFormat(ln(1)) & "', "
strsql2 = strsql2 & "'" & ln(2) & "', "
strsql2 = strsql2 & ln(0) & ", "
strsql2 = strsql2 & ln(4) & ", "
strsql2 = strsql2 & "'" & ln(3) & "') "
_cmd = New SqlCommand(strsql2, connchip)
_cmd.ExecuteNonQuery()
End While
_cmd.Dispose()
f.Close()
f.Dispose()
connchip.Close()
MsgBox("Export Done")
Else
MsgBox("Server not in range")
End If
End If
Catch ex As Exception
MsgBox("import error " & ex.ToString)
End Try
End Sub
Public Function connect2008() As Boolean
connect2008 = False
Dim path As String
Dim database As String
Dim temp As String = ""
Dim temp2(15) As String
Dim server As String
Dim FileReader As StreamReader
FileReader = New StreamReader("\ticketpro\chip.txt")
temp = FileReader.ReadToEnd()
temp2 = Split(temp, ",")
FileReader.Close()
database = temp2(8)
server = temp2(7)
path = "Data Source=eazzi-pc\SQLEXPRESS2012;Initial Catalog=ticketprozaarour; User Id=system; Password=startup;"
Try
connchip = New SqlConnection(path)
connchip.Open()
connect2008 = True
Catch ex As Exception
connect2008 = False
MsgBox("error in function connect 2008")
End Try
End Function
Private Sub TImageButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TImageButton1.Click
Me.Close()
End Sub
End Class
One more thing. he handheld is connected to wifi. and the pc eazzi-pc is connected to the same wifi.
|
|
|
|
|