<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Giorgos Neokleous</title>
    <description>The latest articles on DEV Community by Giorgos Neokleous (@neokleoys2005).</description>
    <link>https://dev.to/neokleoys2005</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F160574%2Fec5678e8-3f41-4505-811f-c36e8dfb0f89.jpg</url>
      <title>DEV Community: Giorgos Neokleous</title>
      <link>https://dev.to/neokleoys2005</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/neokleoys2005"/>
    <language>en</language>
    <item>
      <title>Android ADB Commands (Part 3) Jobs</title>
      <dc:creator>Giorgos Neokleous</dc:creator>
      <pubDate>Fri, 07 Jun 2019 17:45:23 +0000</pubDate>
      <link>https://dev.to/neokleoys2005/android-adb-commands-part-3-jobs-1fgi</link>
      <guid>https://dev.to/neokleoys2005/android-adb-commands-part-3-jobs-1fgi</guid>
      <description>&lt;h1&gt;
  
  
  ADB Commands
&lt;/h1&gt;

&lt;p&gt;Previous posts: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/neokleoys2005/android-adb-commands-part-1-3219"&gt;PART I&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/neokleoys2005/android-adb-commands-part-2-1gog"&gt;PART II&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.android.com/studio/command-line/adb"&gt;Link for more info.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Check a jobscheduler info using the following command:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell dumpsys jobscheduler&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As the output is huge, you should &lt;code&gt;cmd+F&lt;/code&gt; or &lt;code&gt;ctrl+f&lt;/code&gt; for your package name. It should look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;JOB #u0a93/17: eec3709 com.foo.bar.application/com.evernote.android.job.v21.PlatformJobService
    u0a93 tag=*job*/com.foo.bar.application/com.evernote.android.job.v21.PlatformJobService
    Source: uid=u0a93 user=0 pkg=com.samplejobscheduler.application
    JobInfo:
      Service: com.foo.bar.application/com.evernote.android.job.v21.PlatformJobService
      PERIODIC: interval=+15m0s0ms flex=+5m0s0ms
      PERSISTED
      Requires: charging=false deviceIdle=false
      Network type: 2
      Backoff: policy=1 initial=+30s0ms
      Has early constraint
      Has late constraint
    Required constraints: TIMING_DELAY DEADLINE UNMETERED
    Satisfied constraints: CONNECTIVITY NOT_ROAMING APP_NOT_IDLE DEVICE_NOT_DOZING
    Unsatisfied constraints: TIMING_DELAY DEADLINE UNMETERED
    Earliest run time: 07:23
    Latest run time: 12:23
    Ready: false (job=false pending=false active=false user=true)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see, the requirements set when scheduling the job are included in the output as well as the backoff policy, network etc.&lt;br&gt;
The most important info&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Earliest run time: 07:23&lt;br&gt;
Latest run time: 12:23&lt;br&gt;
Ready: false (job=false pending=false active=false user=true)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are testing on &lt;strong&gt;Android 7.1 and higher&lt;/strong&gt;, then you can force-run a scheduled job using the following command. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell cmd jobscheduler run -f PACKAGE_NAME JOB_ID&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;PACKAGE_NAME&lt;/strong&gt; should be the package of your app.&lt;br&gt;
&lt;strong&gt;JOB_ID&lt;/strong&gt; is set when scheduling a job&lt;/p&gt;

&lt;p&gt;An excellent SO answer on &lt;strong&gt;how-to read&lt;/strong&gt; the output and &lt;strong&gt;what tools are available&lt;/strong&gt; for job schedulers &lt;a href="https://stackoverflow.com/a/42133270/3330058"&gt;check it out&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>mobile</category>
      <category>testing</category>
    </item>
    <item>
      <title>Android ADB Commands (Part 2) Alarms</title>
      <dc:creator>Giorgos Neokleous</dc:creator>
      <pubDate>Sat, 04 May 2019 10:30:26 +0000</pubDate>
      <link>https://dev.to/neokleoys2005/android-adb-commands-part-2-1gog</link>
      <guid>https://dev.to/neokleoys2005/android-adb-commands-part-2-1gog</guid>
      <description>&lt;h1&gt;
  
  
  ADB Commands
&lt;/h1&gt;

&lt;p&gt;Previous post: &lt;a href="https://dev.to/neokleoys2005/android-adb-commands-part-1-3219"&gt;PART I&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.android.com/studio/command-line/adb"&gt;Link for more info.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Check if alarms are set and when they are scheduled to trigger&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell dumpsys alarm&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The command is extremely verbose, I will recommend to filter with grep such as&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell dumpsys alarm | grep com.package.name&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Tip 1:&lt;/strong&gt; If you are not going to use &lt;strong&gt;grep&lt;/strong&gt; or something similar use &lt;strong&gt;cmd+F&lt;/strong&gt; or &lt;strong&gt;ctrl+F&lt;/strong&gt; to find your app by searching the package name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip 2:&lt;/strong&gt; If your terminal's buffer size is not big enough, and you are not using the grep command, it might better to output into a file. &lt;/p&gt;

&lt;p&gt;i.e &lt;code&gt;adb shell dumpsys alarm &amp;gt; AlarmsOutput.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The output looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Batch{28b15ce num=18 start=60346095 end=65172917 flgs=0x8}:

    RTC #17: Alarm{ae74957 type 1 when 1491279601728 com.package.name}

      tag=*alarm*:Alarm_Intent

      type=1 whenElapsed=+11h57m57s410ms when=2019-04-04 07:20:01

      window=+8h59m59s997ms repeatInterval=0 count=0 flags=0x0

      operation=PendingIntent{d1cec44: PendingIntentRecord{d3307ba com.package.name broadcastIntent}}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;As you can see from above the &lt;strong&gt;when=&lt;/strong&gt; tells us when is set to get triggered.&lt;/p&gt;

&lt;p&gt;This is extremely helpful for debugging and verifying AlarmManager's behaviour.&lt;/p&gt;

&lt;p&gt;An excellent SO answer on &lt;strong&gt;how-to read&lt;/strong&gt; the output, &lt;a href="https://stackoverflow.com/a/31600886/3330058"&gt;check it out&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stay tuned for the third part soon!&lt;/p&gt;

</description>
      <category>android</category>
      <category>mobile</category>
      <category>testing</category>
    </item>
    <item>
      <title>Android ADB Commands (Part 1) Battery</title>
      <dc:creator>Giorgos Neokleous</dc:creator>
      <pubDate>Sat, 27 Apr 2019 18:58:50 +0000</pubDate>
      <link>https://dev.to/neokleoys2005/android-adb-commands-part-1-3219</link>
      <guid>https://dev.to/neokleoys2005/android-adb-commands-part-1-3219</guid>
      <description>&lt;h1&gt;
  
  
  ADB Commands
&lt;/h1&gt;

&lt;p&gt;According to documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.android.com/studio/command-line/adb"&gt;Link for more info.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will try through a series of posts to go through my favorite commands.&lt;/p&gt;

&lt;p&gt;1) Set battery level&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell dumpsys battery set level 5&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The command above, sets the phone's battery to 5%. This could be used to test how the app behaves with low battery level, or if your dark theme is being enabled etc.&lt;/p&gt;

&lt;p&gt;Reset the battery level back to the &lt;strong&gt;real&lt;/strong&gt; one with&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;adb shell dumpsys battery reset&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://dev.to/neokleoys2005/android-adb-commands-part-2-1gog"&gt;Part two available now&lt;/a&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>mobile</category>
      <category>testing</category>
    </item>
    <item>
      <title>First Dev.to post</title>
      <dc:creator>Giorgos Neokleous</dc:creator>
      <pubDate>Thu, 25 Apr 2019 15:59:23 +0000</pubDate>
      <link>https://dev.to/neokleoys2005/first-dev-to-post-17lh</link>
      <guid>https://dev.to/neokleoys2005/first-dev-to-post-17lh</guid>
      <description>&lt;p&gt;Hey,&lt;/p&gt;

&lt;p&gt;I'm new here. First impression, the community looks awesome.&lt;/p&gt;

&lt;p&gt;I'm looking for Android Devs or discussions to follow. Can anyone recommend me some?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
      <category>android</category>
    </item>
  </channel>
</rss>
