4GB/128GB vs 6GB/64GB?
- By lvt
- VIP Lounge
- 9 Replies
Which option should you go with? And why?
The OS being Oreo, eventually upgraded to Pie.
The OS being Oreo, eventually upgraded to Pie.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
public class Connection extends android.telecom.Connection {
private static final String TAG = "Connection";
public Connection() {
super();
setConnectionProperties(android.telecom.Connection.PROPERTY_SELF_MANAGED);
}
@Override
public void onStateChanged(int state) {
super.onStateChanged(state);
Log.i(TAG, "onStateChanged state=" + android.telecom.Connection.stateToString(state));
}
public void setConnectionDisconnected(int cause) {
setDisconnected(new DisconnectCause(cause));
destroy();
Log.i(TAG, "disconnected");
}
public void displayIncomingCallNotification() {
final NotificationManager notificationManager = (NotificationManager) Config.context.getSystemService(Config.context.NOTIFICATION_SERVICE);
String NOTIFICATION_CHANNEL_ID = "my_channel_id_01";
Handler.Callback callback = new Handler.Callback() {
public boolean handleMessage(Message msg) {
Log.d("Call", "back");
return true;
}
};
PendingIntent dismissIntent = NotificationActivity.getDismissIntent(1, Config.context, callback);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, "My Notifications", NotificationManager.IMPORTANCE_HIGH);
notificationChannel.setDescription("Channel description");
notificationChannel.enableLights(true);
notificationChannel.setLightColor(Color.RED);
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
notificationChannel.setSound(ringtoneUri, new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build());
notificationManager.createNotificationChannel(notificationChannel);
}
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(Config.context, NOTIFICATION_CHANNEL_ID);
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClass(Config.context, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(Config.context, 1, intent, 0);
notificationBuilder.setAutoCancel(true)
.setDefaults(Notification.DEFAULT_ALL)
.setWhen(System.currentTimeMillis())
.setSmallIcon(android.R.drawable.sym_action_call)
.setTicker("Hearty365")
//.setPriority(Notification.PRIORITY_HIGH)
.setContentTitle("Default notification")
.setContentText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
.setContentInfo("Info")
.setOngoing(true)
.setContentIntent(pendingIntent)
.setFullScreenIntent(pendingIntent, true)
.addAction(android.R.drawable.sym_call_incoming, "Accept", null)
.addAction(android.R.drawable.sym_call_missed, "Decline", dismissIntent);
final Notification notification = notificationBuilder.build();
notification.flags |= Notification.FLAG_INSISTENT;
new android.os.Handler().postDelayed(
new Runnable() {
public void run() {
notificationManager.notify(1, notification);
}
},
4200);
}
@Override
public void onShowIncomingCallUi() {
displayIncomingCallNotification();
Log.i(TAG, "onShowIncomingCallUi ");
}
@Override
public void onDisconnect() {
setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
destroy();
Log.i(TAG, "disconnected local");
}
@Override
public void onReject() {
setDisconnected(new DisconnectCause(DisconnectCause.REJECTED));
destroy();
Log.i(TAG, "disconnected reject");
}
@Override
public void onAnswer() {
Log.i(TAG, "Call answered");
}
}
public class NotificationActivity extends Activity {
public static final String NOTIFICATION_ID = "NOTIFICATION_ID";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.cancel(getIntent().getIntExtra(NOTIFICATION_ID, -1));
finish();
}
public static PendingIntent getDismissIntent(int notificationId, Context context) {
Intent intent = new Intent(context, NotificationActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.putExtra(NOTIFICATION_ID, notificationId);
PendingIntent dismissIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
return dismissIntent;
}
}
package com.example.anitaa.student;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
public class MainActivity extends AppCompatActivity {
TextView text;
Button b1;
String url1="http://192.168.1.3/student/web/index.php?r=message/display";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text=(TextView) findViewById(R.id.text_content);
b1=(Button) findViewById(R.id.btn5);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final RequestQueue requestQueue1= Volley.newRequestQueue(MainActivity.this);
StringRequest stringRequest1=new StringRequest(Request.Method.POST, url1, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
text.setText(response);
requestQueue1.stop();
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
text.setText("Error");
error.printStackTrace();
requestQueue1.stop();
}
});
requestQueue1.add(stringRequest1);
}
});
}
}