Sunday, November 20, 2016

Activity does not have the latest intent information put in the pending intent extras

It happens when the activity is resumed.

You need to:

1. In the intent:
    intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
  PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
        PendingIntent.FLAG_UPDATE_CURRENT);

2. In the Activity the pending intent is calling:

   @Override
   public void onNewIntent(Intent newIntent) {
    Log.i(P.Tag, "===onNewIntent called===");
    this.setIntent(newIntent);
   }

Friday, November 11, 2016

How to uninstall an app from wearable



Android wear connect via Bluetooth

adb forward tcp:4444 localabstract:/adb-hub
adb connect 127.0.0.1:4444


Uninstall a standalone app


adb -s 127.0.0.1:4444 uninstall com.netcompss.fl_groups


If you want to uninstall a regular app, then just uninstall the phone app, and the wearable app will uninstall automaticly

Friday, October 28, 2016

OK Google beep sound fix

Google decided to remove the beep sound from the OK Google assistant.
Lots of users hate this decision, giving the Google app bad reviews, but Google will not fold.

Here is how to get the beep sound back in a few easy steps:

Setting, accessibility, switch access to on.

Here is a video that shows, the issue, and how to solve it:

https://youtu.be/NFws1vnKJ0M

Sunday, September 18, 2016

Simple Java Timer (Can be used in Android)

With the default fixed-period execution, each successive run of a task is scheduled relative to the start time of the previous run, so two runs are never fired closer together in time than the specified period. With fixed-rate execution, the start time of each successive run of a task is scheduled without regard for when the previous run took place. This may result in a series of bunched-up runs (one launched immediately after another) if delays prevent the timer from starting tasks on time.

// First run after 2000ms, next run after 1000ms
public static void testTimer() {
Timer timer = new Timer();
timer.schedule(new TimerTask() {
int i = 0;
@Override
public void run() {
Random rand = new Random();
int randInt5000 = rand.nextInt(5000);
System.out.println("working : " + randInt5000);
try {
Thread.sleep(randInt5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
i++;
if (i == 5) timer.cancel();
}

}, 2000, 1000);

}

Monday, July 25, 2016

Sending a Toast from a Service

Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() { @Override public void run()
{
    Toast.makeText(getApplicationContext(), "Detection Service Failed, restart it", Toast.LENGTH_LONG).show();
}
});

Sunday, June 19, 2016

Security Camera Help


Security Camera is an Advanced Security / Spy / Baby, Pet Monitor App, available for free download on Google Play.

Operation Modes

Motion detection with video

This is the default operation mode, it will take image every x seconds (default is 3), 
and will run motion detection on it. If motion is detected, 
it will upload a the picture to your Google Drive
Account, and will record a video.
The quality of the video can be controlled from the app setting,
it will effect the time of the recorded video.
The lower the video quality the longer the video.

Pictures Only

The same as above, but will not record a video (will only upload a picture).

Video Burst

Records a sequence of videos (The default is 4).
After the recording is over, will return to the previous mode of operation.
This mode is useful when a major event is detected, and you need to have more information on it.
This (as all over modes) can be controlled remotely by the controller.

Audio Only

The same as the first mode, but instead of recording video, it will record a high quality audio.
This mode is useful when audio is more important, and you want to save battery, and get the uploads 
media more quickly.


The Controller

All your detectors (phone devices that acts as motion detectors), can be controlled remotely
Using the Controller,
Your detectors can be anywhere in the world, in a place with internet connection,
And your controller will be able to control them.
The controller will send the control command to the detectors (you will see the message: 
"command was sent"), and the detector will act according to the new command.
For example, if you changed the mode to video burst, all the videos from the video burst, 
will be pushed to your Viewer/CTRL device. 
If you change the video to high quality, a high quality video will be pushed to your device.




Tips & Tricks

+ Its recommended to connect the detector to a power source. 
It could be a regular charger, but if not available, you can use a power stick.
Our tests shows that on regular use, a detector could last without power for around 6 hours.
But since most devices used as a detectors are old ones (and their battery is used), 
the above is recommended. 

+ Make sure your device WiFi is not configured to stop when the device sleeps.



+ When detection service is on, its recommended to leave the security camera app on the front 
Before switching the device screen off (putting device to sleep).
This way Android will not kill the detection service.

+ When done with the detection service, 
make sure you switch it off before continuing using your 
device as a regular device.
Failing to do so will drain the battery an upload unnecessary media to your Google Drive. 




+ You can setup your device as as both Detector and Viewer for testing purposes.
  To do this, simply restart the wizard (options, Restart Setup Wiz), and setup your device 
  Again, make sure you use the same Google Account.

  

  This way your device will be able to capture images and videos, and also get them via push
  Notifications
  


Tuesday, May 31, 2016

Google play Error 505

This is a nasty one,
It happens when trying to install an app for some unknown reason,
I heard of some users that did factory reset to solve this.

Basically all you have to do is to use adb to uninstall the app, and you will be able to install again the app from Google Play.

Install Google Android SDK.
Open Command Console
run:
adb uninstall <the app full package name>