« first day    last day (407 days later) » 
06:00 - 12:0012:00 - 14:00

6:33 AM
Sure u wanna check for network and GPS enable/disable inside activity and then start the Service
 
 
3 hours later…
9:35 AM
i just gave a toast in getlocation()
@kevz
how to stop that service
stopService(intent);
stopService(new Intent(GPSTracker.LOCATION_SERVICE));
finish();
this is not working
 
10:02 AM
stop it from activity
stopService(new Intent(YourActivity.this, YourService.class));
Y u wanna stop it?
 
tried that..
stopService(new Intent(MainActivity.this, GPSTracker.class));
 
Y u wanna stop it?
 
coz it should start on a click and stop on a click
 
gotcha
did u read about START_STICKY?
not???
 
10:06 AM
okay
 
change it to START_NOT_STICKY
 
try it...
 
done
executing
 
10:09 AM
okay
 
hey
its giving error
 
wt is it?
 
android.app.Service
public static final int START_NOT_STICKY = 2
Constant to return from onStartCommand: if this service's process is killed while it is started (after returning from onStartCommand), and there are no new start intents to deliver to it, then take the service out of the started state and don't recreate until a future explicit call to Context.startService(Intent). The service will not receive a onStartCommand(Intent, int, int) call with a null Intent because it will not be re-started if there are no pending Intents to deliver.
description
ok just wait
 
alright
 
executed
 
10:13 AM
wt did u do?
 
deleted return START_STICKY;
added return START_NOT_STICKY;
 
Ohhh u had 2 return stmt
 
and executed
 
g8 it worked
 
kevz..where r u from
 
10:14 AM
India
 
your full name
 
its too quick to answer that but my First name is 'Ketan'.
 
wt is this kevz then
nick name??
 
yep
 
10:18 AM
I call it to myself
 
:D
even i'll call u the same
 
its okay
where u frm?
I mean in India?
 
India obviously
telangana state
south indian
 
Far away
 
10:20 AM
I'm from Pune.
 
"
Far away"
by this stmt i thought u r from j&k
 
yeah
ohh okay
done with ur task?
 
good
I'm not allowed cellphone @ work place
 
but it was not possible vthout ur help
 
10:23 AM
all i got is stackoverflow
 
:)
congo
 
everything is possible
wts congo?
 
congratulations
 
abouT?
 
"
I'm not allowed cellphone @ work place"
for this
 
10:25 AM
its too boring without it
 
i know
look..its not working
 
wt?
 
stoping a service
 
again?
wt's the error?
 
no error
btnStopLocation = (Button) findViewById(R.id.stop);

// show location button click event
btnStopLocation.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View arg0)
{
stopService(new Intent(MainActivity.this,GPSTracker.class));
Toast.makeText(getApplicationContext(), " Service stoped", Toast.LENGTH_LONG).show();
}
});
here goes the code
 
10:28 AM
put that ti\oast inside onDestroy() of service
check if its get called
how come u know its not stopped
 
data is uploading contnsly
in db
 
okay check if Toast is displayed?
 
within onDestry()??
on button click it is displaying
 
yeah but its not stopped
so put it in onDestroy() we'll come to know
 
ok
stopService(new Intent(MainActivity.this,GPSTracker.class));
onDestroy();
Toast.makeText(getApplicationContext(), " Service stoped", Toast.LENGTH_LONG).show();
like this
??
stopService(new Intent(MainActivity.this,GPSTracker.class));
onDestroy(){
Toast.makeText(getApplicationContext(), " Service stoped", Toast.LENGTH_LONG).show();
}
this is not happening
 
10:33 AM
nope override onDestroy() inside service
and place that Toast der
 
I'll w8
 
ooo...a method which belongs to service//
i've written in onClick
:P
 
10:37 AM
yeah u did that
my bad
 
hmm
done
on click of stop it gave toast
 
still the service is recreated???
 
yup
its running
and sending data to server
 
let me check
 
10:45 AM
try to google it
I need some time
 
I'll get back to u l ater
 
ok..babye
 
see ya
gotcha
use the same intent to stop service
class Activity{
Intent intent;
oncreate(){
intent = new Intent(context, .class);
startService(intent)
}
to stop the service use same intent
btnStopService.setonclickListener(){
stopService(intent);
}
that's it
 
okk
oye
look at the previous code
 
10:57 AM
which?
I don't rem just gave a sample structure
 
i think i tried this
 
make changes in ur code
 
    final Intent intent = new Intent(MainActivity.this, GPSTracker.class);
declared intent as final in onCreate()
 
declare it as class member
 
okk
context
 
11:00 AM
wt context?
 
intent = new Intent(context, .class);
argument as context
error there
shall i take base context
 
take activity's context
did?
 
    final Intent intent = new Intent(getApplicationContext(), MainActivity.class);
??
 
just declare it
don't define it
define it on btnClick where u wanna start service
not Application context
MainActivity.this
 
MainActivity.this Mainactivity.class??
both in intent
 
11:06 AM
rt
 
done?
 
doin
there
??
 
yep
done?
 
i declared it in onCreate
Intent intent;
ok...
 
11:13 AM
don't do it der
 
ok
in class
??
 
declare it outside oncreate() as class member
public class MainActivity extends Activity{
 
done done
 
Intent intent;
 
                    intent = new Intent(MainActivity.this, MainActivity.class);
within onClick
 
11:14 AM
now define it in onCreate()
 
2nd arg is YourService.class
gotcha?
 
stopService(intent);
 
rt
 
okk
previously we did all this within onClick
now arranged it
lemme execute it now
 
11:16 AM
I didn't knew service stops on btnclick
 
will it??
 
wt?
 
service stops on btnclick??
or not
 
sure it'll if u did it rt
I mean use the same intent to stop
 
yeah its the same intent
 
11:19 AM
so did it worked?
 
data entered on start
let it enter 2 values
i'll stop
 
okay
 
onDestry is called
got toast
okk
 
is the service still running?
 
it is just skipping 1 iteration
yes it is
 
11:21 AM
omg
 
i gave 30 seconds time limit
 
wt time limit?
 
i mean min time gap
                    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,30000,0, this);
 
did u unregister locationlistener?
 
11:24 AM
do this
locationManager.removeUpdates(your location listener);
 
inside ondestroy() of service
 
is it working?
 
checking
no where i used LocationListener
object
so shall i declare LocationListener Locationlistener;
and use it only in onDestroy()
 
11:30 AM
locationManager.requestLocationUpdates(provider, 1000, 0, your_location_listener);
that last arg
 
i used this there
 
for now in ondestroy
 
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,30000,0, this);
locationManager.removeUpdates(this);
??
 
rt
 
sorry for silly questions
:(
 
11:31 AM
its okay
it happens with everyone
 
hmmm
executed
clicked start
 
okay
 
3 values entered
clicked stopped
.
and
.
 
?
 
only 3 entries.... :)
 
11:35 AM
g8
 
stop hogay
 
good
 
thank u thanku3
 
u don't have to tnx me
ur welcome
 
wts ur experience on android
 
11:36 AM
a year
 
mine 3 months expernce
 
u r doin g8
 
:P
i donno any thing
 
problems to aate hai bas unko face karo
solutions to hote hai bas dhoondne padte hai
 
i was reading ur sentence in english
tryt to do that
hmmm
 
11:39 AM
its funny in english
 
very funny
 
hehehe
 
and thode genius log bhi rehte hey so mey
kevz jaise
 
I'm still a learner
Always live in uncomfortable zone
u'll learn more
 
11:42 AM
I came across new things everyday
which i haven't heard b4
 
like what
 
I don't know how to upload data on server
never did it b4
 
every one will have a server at their home right
 
and a person with incomplete knowledge is a learner
I've got lappy
 
it is a new thing for every one
ok
 
11:45 AM
yeah
wt r ur hobbies?
 
just a min kevz
lemme upload this
dont mind
 
take ur time
never
 
my hobbies r wasting time
i just love to do that
being idle
:)
 
really?
wt about quality time?
 
wts that
 
11:50 AM
i mean wt the quality time for u apart from being idle?
 
yeh word 1st time suna hey
quality time
very professional
 
okay
 
quality time mey i would love 2 cook
north indian dishes
 
like?
 
non veg
 
11:53 AM
g8
 
hope u r not a vegetarian
 
nope
do u know to cook fish?
 
g8 I know to fry
never cooked a fish curry
 
yaik
i hate curry
only fry
 
11:55 AM
so do I
 
same here
 
same pinch then
 
same pinch
u free?
 
11:57 AM
got 1 task to do
 
okk
wanna say catch u later??
 
gimme some time
I'll brb
 
sure
take ur time
 
tnx
 
06:00 - 12:0012:00 - 14:00

« first day    last day (407 days later) »