Skip to content

Instantly share code, notes, and snippets.

Matheus Jardim Bernardes matheusjardimb

Block or report user

Report or block matheusjardimb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Android Play incondicional sound.java
final String packageName = getPackageName();
Uri alarmSound = Uri.parse("android.resource://" + packageName + "/" + R.raw.my_audio);
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(this, alarmSound);
mp.setAudioStreamType(AudioManager.STREAM_ALARM);
mp.prepare();
mp.start();
AudioManager mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
@matheusjardimb
matheusjardimb / search.xml
Last active Aug 29, 2015
SearchView xml menu
View search.xml
<menu xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/search"
android:title="@string/my_title"
app:actionViewClass="android.widget.SearchView"
android:showAsAction="always"
app:showAsAction="always"
View edit_text.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:drawable="@drawable/textfield_search_selected_holo_light" />
<item android:drawable="@drawable/textfield_search_default_holo_light" />
</selector>
@matheusjardimb
matheusjardimb / YoutubeUtils
Created Nov 14, 2014
Get Youtube thumb url from video Id
View YoutubeUtils
/**
*
* Created by matheusjardimb on 14/11/2014.
*/
public class YoutubeUtils {
private static final String BASE_URL = "http://img.youtube.com/vi/";
private static final String EXT = ".jpg";
public static String getThumbUrl(String videoId) {
return getThumbUrl(videoId, VideoSize.DEFAULT);
View facebook_share_intent
public static void shareURL(Context context, String url) {
try {
Intent intent1 = new Intent();
intent1.setClassName("com.facebook.katana", "com.facebook.composer.shareintent.ImplicitShareIntentHandler");
intent1.setAction("android.intent.action.SEND");
intent1.setType("text/plain");
intent1.putExtra("android.intent.extra.TEXT", url);
context.startActivity(intent1);
} catch (Throwable e) {
// If native FB app is not installed, try share through SEND (browser or 3rd party apps)
View android_colors
<?xml version="1.0" encoding="utf-8"?>
<!--
Great set of colors from from http://flatuicolors.com/ and converted into Android colors.xml
-->
<resources>
<color name="turquoise">#1abc9c</color>
<color name="emerald">#2ecc71</color>
<color name="peter_river">#3498db</color>
View OneNmae
Verifying that +matheusjardimb is my blockchain ID. https://onename.com/matheusjardimb
View Vaga-Django-Porto-Alegre
VAGA:
- Startup contrata desenvolvedor backend
Perfil:
Profissional comunicativo e ágil, capaz de se adequar ao ambiente dinâmico de uma start-up.
Motivado, pró-ativo e atento às novas tecnologias e tendências.
Esperamos ensino superior na área (cursando ou concluído) além de experiência com desenvolvimento web.
Precisará ter facilidade com o inglês e capacidade de se organizar.
Responsabilidades:
@matheusjardimb
matheusjardimb / printKeyHash.java
Created Jan 4, 2017
Android - Print Key Hash
View printKeyHash.java
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.util.Base64;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
//...
private void printKeyHash() {
@matheusjardimb
matheusjardimb / MyActivity.java
Last active Apr 12, 2018
SearchView Activity
View MyActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.search, menu);
final MenuItem item = menu.findItem(R.id.search);
if (item != null) {
final View actionView = item.getActionView();
if (actionView != null) {
SearchView searchView = (SearchView) actionView;
You can’t perform that action at this time.