This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyAsyncTask extends AsyncTask<Void, Void, Cursor> { | |
@Override | |
protected Cursor doInBackground(Void... params) { | |
DatabaseHelper helper = new DatabaseHelper(MainActivity.this); | |
return helper.getReadableDatabase().rawQuery("SELECT * FROM myTable", null); | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean is(Context context) { | |
try { | |
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
if (cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnected()) { | |
return true; | |
} else if(cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnected()){ | |
return true; | |
} else { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get download directory | |
File imgFile = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); | |
if(imgFile.exists()) { | |
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getPath() + "/ovo.jpg"); | |
ivImagem.setImageBitmap(myBitmap); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loaded 7643 mappings | |
gradle/topics/gradle-signing-with-incorrect-key maps to topic 5227 | |
gradle/topics/how_do_you_use_variables_on_the_eclipse_plugin_to_generate_the_classpath maps to topic 3175 | |
gradle/topics/why-are-replace-tokens-and-expand-properties-not-part-of-the-inputs-of-the-copy-task maps to topic 5232 | |
mapping missing for Showing an example of running Selenium2 WebDriver on Groovy using Gradle 245 | |
gradle/topics/remove-native-build-tasks maps to topic 5231 | |
gradle/topics/friendlier_way_to_customize_a_generated_pom maps to topic 4968 | |
gradle/topics/copy_w_duplicatesstrategy_exclude_overwrites_files maps to topic 1945 | |
mapping missing for Compile groovy with debugging information 5226 | |
gradle/topics/can-i-tell-which-tasks-were-explicitly-run-i-e-tell-primary-tasks-from-dependencies maps to topic 5228 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package robotograph; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.util.AttributeSet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Typeface face = Typeface.createFromAsset(getAssets(), "yourfont.ttf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListFragment extends Fragment { | |
//DAO datasource; | |
//List<Joke> values; | |
public ListFragment(){} | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.test_fragment_list, container, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Android 4.3+ changes app's internal directory permissions and you can not just pull your | |
# databases to your computer, so I did this as a workaround to extract my databases. | |
# I only use it for debug, use it under your responsability. | |
package=$1 | |
db_name=$2 | |
path="/data/data/$package/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Server port=”-1” command=”SHUTDOWN”> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ILib { | |
alpha: string[], | |
number: string[], | |
symbols: string[] | |
} | |
type Key = keyof ILib; | |
const lib : ILib = { | |
alpha: [ |
OlderNewer