неделя, юли 16, 2017

Debug trace files location on Nexus 5X with Android 7+

After some cursing, because nowhere in Google I could find where these trace files are stored, I finally found them. The location is not mentioned and not even hinted in the 'trace use' documentation.
/sdcard/Android/data/com.company.mygame/files/filename.trace
If we use the os.Debug class to generate trace files and our app package is com.company.mygame:
Debug.startMethodTracing("mytracefile");
Debug.stopMethodTracing();
The file can be found and pulled like:
adb pull /sdcard/Android/data/com.company.mygame/files/mytracefile.trace
ALSO, USING traceview FROM THE COMMAND LINE HAS BEEN DEPRECATED!

вторник, март 04, 2014

Interesting ADB commands

1. Show all events happening in the phone, very useful to debug transitions between activities, background, Home button, launcher icon start, notification icon start, etc.
adb logcat -b events
2. Show current tasks and activities
adb shell dumpsys activity

понеделник, февруари 10, 2014

Android - display AdMob interstitials on app exit

public class MyActivity extends Activity 
{ 
   private static final String MY_AD_UNIT_ID = "...";
   private InterstitialAd interstitial;
 
   @Override
   public void onCreate(Bundle savedInstanceState) 
   {
      super.onCreate(savedInstanceState);
      setupAds();
   }
 
   @Override
   public void onBackPressed() 
   {
      super.onBackPressed();
      if(interstitial.isReady()) {
         interstitial.show();
      } else {
         MyActivity.this.finish();
      }
   }
  
   private void setupAds() 
   {
      interstitial = new InterstitialAd(this, MY_AD_UNIT_ID);
      interstitial.setAdListener(new AdListener() 
      {
         public void onReceiveAd(Ad ad) {}
         public void onPresentScreen(Ad ad) {}
         public void onLeaveApplication(Ad ad) {
            MyActivity.this.finish();
         }
         public void onFailedToReceiveAd(Ad ad, ErrorCode errorCode) {}
         public void onDismissScreen(Ad ad) {
            MyActivity.this.finish();
         } 
      });
      AdRequest adRequest = new AdRequest();
      interstitial.loadAd(adRequest);
   }
}

събота, януари 11, 2014

Samsung NP530 laptop function keys not working on Windows 7

If you have a Samsung Laptop with pre-installed Windows 8 and you decide to downgrade to Windows 7, the function keys of the Laptop may stop working. The drivers from the Samsung Support page are not enough to make the keys work. There's a program - Samsung Easy Settings - which can fix the problem. It's somewhat hard to find in the Samsung web site.

http://org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=US&CttFileID=4965825&CDCttType=SW&ModelType=C&ModelName=NP700Z5C-S01UB&VPath=SW/201206/20120619162202992/Easy_Settings_1.1.1.4.ZIP