DOWNLOAD Galaxy on Fire 2 Full HD Valkyrie for ANDROID




Full Cracked Version!
Pastikan anda tersambung dengan internet saat menginstall game ini di Android anda!Wi-Fi recommended!
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
where "18d1" is the USB Vendor ID for Google, Nexus 7 in my case.Posted by Laurence Moroney, Developer Advocate
In October, we published a blog post about how Google Cloud Messaging (GCM) works with Doze in Android 6.0 Marshmallow to bring performance and usability improvements to the user. In this scenario, normal priority messages allow the device to stay in Doze, while high priority messages take the device out of Doze. For a great example of this capability and best practices on Android, weve spoken with the engineering team at Twitter.
Twitter has researched extensively which messages should get high priority -- given that this priority can awaken a device in Doze. To meet their particular need, Twitter wanted Direct Messages to be delivered on high priority, where mentions would be at normal priority.
Luke Millar, Android Engineering Manager at Twitter commented "With Android M we have a greater ability to be good citizens when it comes to conserving battery life. This feature lets us specify which notifications will wake up a device in Doze and which ones wont. Normally, we tell GCM to wait to deliver push notifications until the next time the users phone wakes up. However, users expect to receive some push notifications immediately, like notifications for Direct Messages, so we set those as high priority. Its nice being able to specify when and how those notifications make it to our users."
To test Doze, Twitters engineers followed the steps outlined on the Android Developers site. These guide you to use adb commands to simulate doze on either a physical or virtual device. Following this method, Twitter was able to successfully test how their messaging priorities would work in a real-world environment.
One other best practice that Twitter used was in transmitting larger payloads, such as when delivering Twitter Highlights. In this case, they opted to pass metadata in the notification, which was then used to sync the application to get the requested Highlights. In other words, they didnt transmit the contents of Highlights in a notification, instead triggering a sync mechanism to update the contents of the app.
For more details on using GCM with your app in standby environments, check out the documentation.
You can learn more about Google Cloud Messaging and how to use it for notifications in your Android, iOS and Web Applications at the Google Developers site here.
![]() |
The Meenova is actually much smaller than it appears here |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context="com.blogspot.android_er.androiddrawbitmap.MainActivity">
<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />
<Button
android_id="@+id/loadimage"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_text="Load Image" />
<Button
android_id="@+id/saveimage"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_text="Save Image" />
<ImageView
android_id="@+id/result"
android_scaleType="centerInside"
android_adjustViewBounds="true"
android_layout_gravity="center"
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_background="@android:color/background_dark" />
</LinearLayout>
package com.blogspot.android_er.androiddrawbitmap;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class MainActivity extends AppCompatActivity {
Button btnLoadImage, btnSaveImage;
ImageView imageResult;
final int RQS_IMAGE1 = 1;
Uri source;
Bitmap bitmapMaster;
Canvas canvasMaster;
int prvX, prvY;
Paint paintDraw;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnLoadImage = (Button)findViewById(R.id.loadimage);
btnSaveImage = (Button)findViewById(R.id.saveimage);
imageResult = (ImageView)findViewById(R.id.result);
paintDraw = new Paint();
paintDraw.setStyle(Paint.Style.FILL);
paintDraw.setColor(Color.WHITE);
paintDraw.setStrokeWidth(10);
btnLoadImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, RQS_IMAGE1);
}
});
btnSaveImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(bitmapMaster != null){
saveBitmap(bitmapMaster);
}
}
});
imageResult.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
int x = (int) event.getX();
int y = (int) event.getY();
switch (action) {
case MotionEvent.ACTION_DOWN:
prvX = x;
prvY = y;
drawOnProjectedBitMap((ImageView) v, bitmapMaster, prvX, prvY, x, y);
break;
case MotionEvent.ACTION_MOVE:
drawOnProjectedBitMap((ImageView) v, bitmapMaster, prvX, prvY, x, y);
prvX = x;
prvY = y;
break;
case MotionEvent.ACTION_UP:
drawOnProjectedBitMap((ImageView) v, bitmapMaster, prvX, prvY, x, y);
break;
}
/*
* Return true to indicate that the event have been consumed.
* If auto-generated false, your code can detect ACTION_DOWN only,
* cannot detect ACTION_MOVE and ACTION_UP.
*/
return true;
}
});
}
/*
Project position on ImageView to position on Bitmap draw on it
*/
private void drawOnProjectedBitMap(ImageView iv, Bitmap bm,
float x0, float y0, float x, float y){
if(x<0 || y<0 || x > iv.getWidth() || y > iv.getHeight()){
//outside ImageView
return;
}else{
float ratioWidth = (float)bm.getWidth()/(float)iv.getWidth();
float ratioHeight = (float)bm.getHeight()/(float)iv.getHeight();
canvasMaster.drawLine(
x0 * ratioWidth,
y0 * ratioHeight,
x * ratioWidth,
y * ratioHeight,
paintDraw);
imageResult.invalidate();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Bitmap tempBitmap;
if(resultCode == RESULT_OK){
switch (requestCode){
case RQS_IMAGE1:
source = data.getData();
try {
//tempBitmap is Immutable bitmap,
//cannot be passed to Canvas constructor
tempBitmap = BitmapFactory.decodeStream(
getContentResolver().openInputStream(source));
Bitmap.Config config;
if(tempBitmap.getConfig() != null){
config = tempBitmap.getConfig();
}else{
config = Bitmap.Config.ARGB_8888;
}
//bitmapMaster is Mutable bitmap
bitmapMaster = Bitmap.createBitmap(
tempBitmap.getWidth(),
tempBitmap.getHeight(),
config);
canvasMaster = new Canvas(bitmapMaster);
canvasMaster.drawBitmap(tempBitmap, 0, 0, null);
imageResult.setImageBitmap(bitmapMaster);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
break;
}
}
}
private void saveBitmap(Bitmap bm){
File file = Environment.getExternalStorageDirectory();
File newFile = new File(file, "test.jpg");
try {
FileOutputStream fileOutputStream = new FileOutputStream(newFile);
bm.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
fileOutputStream.flush();
fileOutputStream.close();
Toast.makeText(MainActivity.this,
"Save Bitmap: " + fileOutputStream.toString(),
Toast.LENGTH_LONG).show();
} catch (FileNotFoundException e) {
e.printStackTrace();
Toast.makeText(MainActivity.this,
"Something wrong: " + e.getMessage(),
Toast.LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(MainActivity.this,
"Something wrong: " + e.getMessage(),
Toast.LENGTH_LONG).show();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.blogspot.android_er.androiddrawbitmap">
<uses-permission android_name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android_largeHeap="true"
android_allowBackup="true"
android_icon="@mipmap/ic_launcher"
android_label="@string/app_name"
android_supportsRtl="true"
android_theme="@style/AppTheme">
<activity android_name=".MainActivity">
<intent-filter>
<action android_name="android.intent.action.MAIN" />
<category android_name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_padding="10dp"
android_orientation="vertical"
android_layout_width="match_parent"
android_layout_height="match_parent">
<ImageView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_src="@mipmap/ic_launcher"/>
<TextView
android_id="@+id/dialogtext"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_textSize="20dp"
android_textStyle="italic|bold"/>
</LinearLayout>
package com.blogspot.android_er.androiddialogfragment;
import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
EditText inputTextField;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
inputTextField = (EditText)findViewById(R.id.inputtext);
Button btnOpen = (Button)findViewById(R.id.opendialog);
btnOpen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showDialog();
}
});
}
void showDialog() {
FragmentTransaction ft = getFragmentManager().beginTransaction();
Fragment prev = getFragmentManager().findFragmentByTag("dialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
String inputText = inputTextField.getText().toString();
DialogFragment newFragment = MyDialogFragment.newInstance(inputText);
newFragment.show(ft, "dialog");
}
public static class MyDialogFragment extends DialogFragment {
String mText;
static MyDialogFragment newInstance(String text) {
MyDialogFragment f = new MyDialogFragment();
Bundle args = new Bundle();
args.putString("text", text);
f.setArguments(args);
return f;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mText = getArguments().getString("text");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View dialogView = inflater.inflate(R.layout.fragment_dialog, container, false);
TextView dialogText = (TextView)dialogView.findViewById(R.id.dialogtext);
dialogText.setText(mText);
return dialogView;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context=".MainActivity"
android_background="#808080">
<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />
<EditText
android_id="@+id/inputtext"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_hint="Type something"/>
<Button
android_id="@+id/opendialog"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_text="Open DialogFragment"
android_textAllCaps="false"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_padding="10dp"
android_orientation="vertical"
android_layout_width="match_parent"
android_layout_height="match_parent">
<ImageView
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_src="@mipmap/ic_launcher"/>
<TextView
android_id="@+id/dialogtext"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_textSize="20dp"
android_textStyle="italic|bold"/>
</LinearLayout>
Copyright © 2009 Gadget Review. Powered by Blogger..
Blogger Templates created by Deluxe Templates