|
you must use WCF service to communicate with sql server
|
|
|
|
|
Hi all, I am creating a android client which is capable to send an image of the current activity from android client to server.I want to send the image continuously from my app and I also want to send the data when I will navigate from one activity to another.Please help with some example code.
|
|
|
|
|
Hello Kumar,
You can find working examples here. Though not related to binary data transmission, but should get you started.
Below is a sample code for a function which I have used in one of the android application I developed.
private JSONObject sendRequest(String strUrl, List<NameValuePair> params) throws Exception
{
String line = null;
String strCKVal = null;
HttpPost httppost = null;
HttpEntity entity = null;
HttpClient httpclient = null;
JSONObject json = null;
InputStream is = null;
HttpResponse response = null;
StringBuilder sb = null;
BufferedReader reader = null;
try
{
httpclient = new DefaultHttpClient();
httppost = new HttpPost(strUrl);
httppost.addHeader("UserAgent","Android");
if (!StringUtils.isEmpty(_strSesId))
httppost.addHeader("Cookie", _strSesId);
httppost.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));
response = httpclient.execute(httppost);
entity = response.getEntity();
is = entity.getContent();
reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8);
sb = new StringBuilder();
while ((line = reader.readLine()) != null)
sb.append(line).append("\n");
CleanupUtils.doClean(reader);
CleanupUtils.doClean(is);
if (sb.length() <= 0)
throw new Exception("Server did not respond ");
for (Header h : response.getAllHeaders())
{
if ("Set-Cookie".equalsIgnoreCase(h.getName()))
{
strCKVal = h.getValue();
break;
}
}
json = new JSONObject(sb.toString());
_strSesId = strCKVal;
return json;
}
finally
{
CleanupUtils.doClean(reader);
CleanupUtils.doClean(is);
if (line != null) line = null;
if (strCKVal != null) strCKVal = null;
if (entity != null) entity = null;
if (httppost != null) httppost = null;
if (reader != null) reader = null;
if (is != null) is = null;
if (response != null) response = null;
CleanupUtils.doClean(is);
if (sb != null)
{
sb.delete(0, sb.length());
sb = null;
}
if (httpclient != null) httpclient = null;
}
}
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
I am thinking to use phonegap to build one hybrid applcation for iOS, android and Windows 8 phone. Has anybody developed an app using phonegap for these three platforms?
Are there any guidelines for windows 8 mobile development to create UI in a particular fashion?
|
|
|
|
|
I have an external source that sends lots of bytes (more than a hundred) to the Uart of a PIC-32.
Problem 1: The PIC-32 Uart does not produce the bytes he is sent; he scrambles the bits
Problem 2: After giving me ten bad bytes, he stops producing anything.
Has anyone ever seen this problem before ?
Did you solve it ?
How ?
|
|
|
|
|
how the android mobile can fetch a voice from application on it and send it by calling
|
|
|
|
|
I write to inquire if there is an entity that keeps track of the usage and geographic distribution of mobile apps.
I am looking for something parallel to the Neilsen rating but for apps.
Any guidance in this regard would be appreciated
|
|
|
|
|
Hi World!
When i wanna to open layout (Main.axml) in disigner in VS2010 for android I get this error : Xamarin.AndroidDesigner.DesignerException
But it works correctly in XML Design.
I wanna to have design !
Please Help!
Thanks in advanced!
|
|
|
|
|
Hey I wanted to find out if it is necessary to use renderscript for image processing apps on android. I'am coding an android panoramic view creator for creating 360 degree high quality panoramas but I had written the initial code in C++, but for android I have to use java and I have read about android phones not being so powerful because of their use of the virtual machine. So I was thinking of using renderscript for the android apps, is it necessary or just normal java code can do for such a task as panorama creation?
“Everything is simple when you take your time to analyze it.”
|
|
|
|
|
|
Hi world,
i am using this code to get info from my sql server 2008.
this is working well in "Debug" mode but cannot run app in mobile(only release work for mobile) SO when i wanna to (Release mode) release it (.apk) and send to my samsung android mobile ,and when i run the app and click on button i get error :
Unhandled Exception CODEPAGE="1256″ not supported
i think it doesnt support
IDbConnection in Release !
and my code is :
void button_Click(object sender, EventArgs e)
{
TextView txts = FindViewById<TextView>(Resource.Id.txt);
txts.Text = "Salam Ali Joon !";
string namess = "";
string connectionString = "Server=217.66.216.77,1633;" +
"Database=testinDB;" + "User ID=testing;" + "Password=arew;";
try
{
IDbConnection dbcon;
using (dbcon = new SqlConnection(connectionString))
{
dbcon.Open();
using (IDbCommand dbcmd = dbcon.CreateCommand())
{
string sql = " SELECT * " +
" FROM persons.[user] ";
dbcmd.CommandText = sql;
using (IDataReader reader = dbcmd.ExecuteReader())
{
while (reader.Read())
{
string FirstName = (string)reader["UserName"];
namess = "user name is : " + FirstName;
}
reader.Close();
dbcon.Close();
}
}
}
txts.Text = namess;
}
catch (Exception ex)
{
txts.Text = ex.Message;
}
}
HELP Please !
|
|
|
|
|
The <mandroidi18n> entry goes into the .csproj, not AndroidManifest.xml.
This can also be set in the IDE.
In MonoDevelop:
Click Project > Project Name Options.
In the left-hand tree, select Build > Mono for Android Build.
In the right-hand pane, select the Advanced tab.
In the Internationalization section, click the checkbox next to west.
Note: Make sure you're changing options for your Release build, not the Debug build.
Within Visual Studio:
Click Project > Project Name Properties.
In the Application tab, look in the Application properties > Additional supported encodings section (it's on the right).
Click the checkbox next to West.
|
|
|
|
|
hi
How can i get your email address mr.Hossein Khalaj
Mine is jojoba2010@gmail.com
thanks in advanced !
|
|
|
|
|
Find a post of his and click the email option. Don't post in an open forum. You've just invited spammers to attack your account.
|
|
|
|
|
Dear Friends, I would like to know how to use MessageBox in Mono for Android in Visual Studio 2010 as code below:
public void DeletarRegistro (int iId)
{
try
{
if (MessageBox.Show("Confirma exclusão? ", "Excluir", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
sSQLQuery = "DELETE FROM MyTable " + "WHERE _id='" + iId + "';";
sqldTemp.ExecSQL(sSQLQuery);
sMensagem = "Record is deleted: " + iId;
MessageBox.Show("Dados Excluídos com sucesso.");
}
}
catch (SQLiteException ex)
{
sMensagem = ex.Message;
}
}
I am awaiting help.
|
|
|
|
|
I don't think you will be able to use MessageBox on Mono Android. MessageBox class is part of System.Windows.Forms package and is not available on Mono for Android. Instead please have a look at AlertDialog Sample[^].
Regards
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
|
All platforms are secure, but it is up to you the user to ensure you install software protection such as anti-virus etc. It only becomes insecure when you start accessing the internet.
|
|
|
|
|
But the preferrable use of the tablets/smartphones is Internet and web services.
|
|
|
|
|
The issues remains the same. Whichever device you choose you will need to ensure it has adequate security software installed.
|
|
|
|
|
What would be you AV software recommendations for Android and iOS?
Now I use the Lookout for Android. Is this a good one?
Thanks.
|
|
|
|
|
No idea, try reading some of the comments and reviews about it.
|
|
|
|
|
oleg63 wrote: Now I use the Lookout for Android. Is this a good one? Most likely, but how do you judge "good"? Try searching for other users' experiences and product reviews.
|
|
|
|
|
This what I usually do. But always would like to have an opinion from another developers, which have wide experience in this area.
|
|
|
|
|
oleg63 wrote: But always would like to have an opinion from another developers, which have wide experience in this area. Then searching via Google will be more likely to find them.
|
|
|
|