|
Cursor cursor = getReadableDatabase().
rawQuery("select * from todo where _id = ?", new String[] { id });
|
|
|
|
|
Hello
I need your help ...
How can I invoke an HTTPS web service from J2ME??
Suppose there is a HTTPS site contains a web service , and I want to invoke this web service from a J2ME Application exists in my mobile phone , How I can do that ???
Please Any helpful Article or project or Video send me...
Thank you all..
I am waiting your reply.....
|
|
|
|
|
Hello,
Here[^] is a good tutorial available on IBM Developerworks.
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
Thank you Prasad P. Khandekar
I ll read chapters ...
|
|
|
|
|
I have a Windows Phone 8 App using SQLite (C#, XAML) I want to create records in my table in code. I tried an experiment by just placing a button on my window that executes a counter to create 10 records in my database. When I execute it, I get no errors, but the records are not in the database. Could you tell me what I am doing wrong?
For instance, with my DataModel:
class Test
{
[SQLite.AutoIncrement, SQLite.PrimaryKey]
public int TestID { get; set; }
public int MyCounter { get; set; }
}
And my View Model
public class TestViewModel : ViewModelBase
{
#region Properties
private int testid = 0;
public int testid
{
get
{ return testid; }
set
{
if (testid == value)
{ return; }
testid = value;
RaisePropertyChanged("TestID");
}
}
private int mycounter = 0;
public int MyCounter
{
get
{ return mycounter ; }
set
{
if (mycounter == value)
{ return; }
mycounter = value;
RaisePropertyChanged("MyCounter");
}
}
#endregion
public string SaveRecord(TestViewModel _vm)
{ string result = string.Empty;
using(var db = new SQLite.SQLiteConnection(app.DBPath))
{
string change = string.Empty;
try
{
var er = (db.Table().Where(
c => c.TestID == _vm.TestID)).SingleOrDefault();
if (er != null)
{
er.MyCounter = _vm.MyCounter;
int success = db.Update(er);
}
else
{
int success = db.Insert(new Test()
{
TestID = _vm.TestID,
MyCounter = _vm.MyCounter,
});
}
result = "Success";
}
catch (Exception ex)
{
StringBuilder erMessage = new StringBuilder();
erMessage.Append("This record was not saved.");
erMessage.AppendLine();
erMessage.Append(ex);
result = "This record was not saved.";
}
}
return result;
}
}
So in my Window I just tried a test
public partial class MyWindow : PhoneApplicationPage
{
RoundShotTest mytest = null;
…..
….
}
private void buttonTryMe_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
For(int x = 0; x < 10; x++)
{
mytest = new TestViewModel();
mytest.MyCounter = x;
string result = mytest.SaveRecord(mytest);
}
What am I doing wrong here. I get no error, but when I take a look in the database, the records have not been written?
|
|
|
|
|
Where do you look in the database? In your debug directory, or in the directory it was originally in? When you develop an application in Visual Studio, the Compile Options (in the Properties page for a particular file) tell you whether or not the file is going to be copied to a different location. Immediately after your loop, select a count of the records to see how many there are.
|
|
|
|
|
Hi Pete,
The db file itself is marked Build Action is set as Content, and Copy to Output Directory is set as Copy if Newer.
In my App.xaml I have:
public partial class App : Application
{
public static IsolatedStorageSettings myappsettings = IsolatedStorageSettings.ApplicationSettings;
private string dbName = "SM.db";
public const string ConnectionString = @"isostore:/SM.db";
private string dBPath = string.Empty;
public static SQLiteAsyncConnection Connection { get; set; }
public string DBPath
{
get
{ return dBPath; }
set
{
if (dBPath == value)
{ return; }
dBPath = value;
}
}
Whats even more weird is that I did this on another app, without the exception of the counter, and it worked. I'm lost?
|
|
|
|
|
Recently, i hired a developer to develop a game for iphone and ipad for me but now i'm quite worry that he will submit it before give it to me, so what can i do to avoid this.
|
|
|
|
|
We are just developers not leagal adviseres...
|
|
|
|
|
I don't know why the 1 voted But I 5'd to make up for it.
Frazzle the name say's it all
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
John F. Woods
|
|
|
|
|
My advice would be to contact a lawyer. I also would consider contacting the apple store.
Frazzle the name say's it all
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
John F. Woods
|
|
|
|
|
I think you such practice is very dangerous, their own electronic products contain their own privacy, it is best not to give others repair esky
|
|
|
|
|
Hi, I am using Sencha. I have created the application and I hosted in server and I can able to search the URL in mobile. Now my question is, I want download my full project files at first time like mobile application and want to install it. How to acheive this?
|
|
|
|
|
|
Hi experts,
I am new to android development.
I want to develop application locker.
In this application i want to set password protection for applications like message, phonebook...
I can get forground application from list of running application, using ActivityManagerclass. Now i want to keep this process running continuously in background so i will make use of service.
But i want to check for running applications list after every second, so my service will be starting and stopping in every second. Is this correct way to implement using service?
And i think after 4.0 android version in idle state system stops services, so how to keep service alive?
Please suggest me correct way to implement this application.
Thanks in advance.
|
|
|
|
|
0 down vote favorite
i'm developping an application that contains an android service (client) that send every minute GPS data to a .net server via tcp protocole, .net server mst receive data and store it in an SQL server.. android client:
{
@Override
public void onStatusChanged(String provider, int status, Bundle extras)
{
}
@Override
public void onProviderEnabled(String provider)
{
}
@Override
public void onProviderDisabled(String provider)
{
}
@Override
public void onLocationChanged(Location location) {
Double latitude = location.getLatitude();
Double longitude = location.getLongitude();
Toast.makeText(getBaseContext(),"Voici les coordonnées de votre téléphone : " + latitude + " " + longitude,Toast.LENGTH_LONG).show();
try {
Socket s = new Socket( "192.168.1.21" , 80);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
String outMsg = latitude.toString();
out.write(outMsg);
out.flush();
Log.i("TcpClient", "sent: " + outMsg);
s.close();
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
};
@Override
public IBinder onBind(Intent arg0)
{
return null;
}
@Override
public void onCreate()
{
locationMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationMgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10000,0, onLocationChange);
locationMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0,onLocationChange);
super.onCreate();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
return super.onStartCommand(intent, flags, startId);
}
@Override
public void onDestroy()
{
super.onDestroy();
locationMgr.removeUpdates(onLocationChange);
}
}
.net server program
public partial class WebForm1 : System.Web.UI.Page
{
private TcpListener tcpListener;
private Thread listenThread;
protected void Page_Load(object sender, EventArgs e)
{
this.tcpListener = new TcpListener(IPAddress.Any, 3000);
this.listenThread = new Thread(new ThreadStart(ListenForClients));
this.listenThread.Start();
}
private void ListenForClients()
{
this.tcpListener.Start();
while (true)
{
TcpClient client = this.tcpListener.AcceptTcpClient();
Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm));
clientThread.Start(client);
}
}
private void HandleClientComm(object client)
{
TcpClient tcpClient = (TcpClient)client;
NetworkStream clientStream = tcpClient.GetStream();
byte[] message = new byte[4096];
int bytesRead;
while (true)
{
bytesRead = 0;
try
{
bytesRead = clientStream.Read(message, 0, 4096);
}
catch
{
break;
}
if (bytesRead == 0)
{
break;
}
ASCIIEncoding encoder = new ASCIIEncoding();
System.Diagnostics.Debug.WriteLine(encoder.GetString(message, 0, bytesRead));
ConnectionStringSettings connection = ConfigurationManager.ConnectionStrings["Connection"];
SqlConnection maConnexion = new SqlConnection(connection.ConnectionString);
maConnexion.Open();
SqlCommand command = new SqlCommand("INSERT INTO Table1 (longitude,latitude,altitude,vitesse) VALUES ('" + message + " '0','0',' 0" + "')", maConnexion);
command.ExecuteNonQuery();
}
tcpClient.Close();
}
}
}
For now i don't get any error but this code doesn't word!! pleaaaze help meee
|
|
|
|
|
Hello,
Please have a look at my answer[^] to similar post.
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
Hi i have written App in VS2010 for android (apk) now how can i convert the source to get jar(and jad) OR (sis for nokia) so can run on there mobiles like nokia OR samsung (old).
Thanks in advnaced~
modified 1-Apr-13 15:48pm.
|
|
|
|
|
|
thanks in advnaced!
But i cannot make it to work on my nokia(i get error).
Plz help
|
|
|
|
|
Those that do not link to the Android framework (which are probably only a few utility classes) should be reusable for another platform.
So, if your application links to the Android framework, then it's not reusable on Nokia.
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
thanks
but what is use of these.
i wanna to convert it to jar file that can use in nokia mobile
|
|
|
|
|
If it links to the Android framework, then you can't use it on Nokia, unless you rewrite your application.
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
|
You're welcome!
The quick red ProgramFOX jumps right over the Lazy<Dog> .
modified 2-Apr-13 3:27am.
|
|
|
|