Skip to content

Instantly share code, notes, and snippets.

View Amokrane's full-sized avatar
🎯
Focusing

Amokrane Chentir Amokrane

🎯
Focusing
View GitHub Profile
@Amokrane
Amokrane / AdbCommands
Created February 14, 2023 20:48 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
// When initializing Criteo
try {
// initialization code
} catch (Exception e) {
// all exceptions will be caught (the checked and unchecked)
}
// when accessing Criteo object
@Nullable
private Criteo getCriteoSafely() {

First cold start (right after installation)

I ActivityTaskManager: Displayed com.Slack/.ui.walkthrough.WalkthroughActivity: +3s59ms

Second cold start (rebooted the device and relaunched)

I ActivityTaskManager: Displayed com.Slack/.ui.HomeActivity: +1s946ms

@Amokrane
Amokrane / file.md
Created February 2, 2016 22:44 — forked from dlew/file.md
Android permissions library proliferation
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx"
android:installLocation="auto"
android:versionCode="30"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
Intent intent = new Intent(MainScreen.this, TabbedView.class);
Bundle bundle = new Bundle();
bundle.putParcelableArray(HEADLINES_FOR_SPORT_EXTRA, existingSportHeadlines.get(selectedSportName));
bundle.putParcelableArray(SCORES_FOR_SPORT_EXTRA, existingSportScores.get(selectedSportName));
bundle.putParcelableArray(SCHEDULE_FOR_SPORT_EXTRA, existingSportSchedule.get(selectedSportName));
intent.putExtras(bundle);
intent.putExtra(SPORT_NAME_EXTRA, selectedSportName);
@Amokrane
Amokrane / RevealNavbar.java
Created April 12, 2012 08:08
Revealing the NavBar using a translation
TranslateAnimation translateAnim = new TranslateAnimation(0.0F, mListView.getWidth(), 0.0F, 0.0F);
translateAnim.setDuration(..);
translateAnim.setFillAfter(true);
mTopLayerView.startAnimation(translateAnim);
@Amokrane
Amokrane / navbar.xml
Created April 12, 2012 08:07
Layout Configuration for a navigation bar
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- This is the Lower Layer hosting the navbar -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<!-- ListView representing the navbar -->
@Amokrane
Amokrane / task_launcher.rb
Created April 9, 2012 14:56
Task launcher
def perform
begin
code = IronWorkerNG::Code::Ruby.new
code.merge_worker File.dirname(__FILE__) + '/c2dm_iron_worker.rb'
code.merge_dir '../config'
code.merge_gem 'activerecord'
# Initialize the client
client = IronWorkerNG::Client.new(:token => 'xxx', :project_id => 'xxx')
# Upload the code
@Amokrane
Amokrane / new_iron_worker.rb
Created April 9, 2012 11:57
New Iron Worker
puts "IronWorker::Starting C2dmIronWorker at #{Time.now}"
puts "IronWorker::We got following params #{params}"
uri = URI.parse('https://android.clients.google.com/c2dm/send')
params['c2dms'].each do |c|
data = {}
data['registration_id'] = c['c2dm']['registration_id']
data['collapse_key'] = `uuidgen`.strip.gsub('-', '')