In this Project you will find various type of Android Studio Projects and Components by Using Java ♨️
Glide Library Dependency:
implementation 'com.github.bumptech.glide:glide:4.9.0'
Code :
Glide.with(this).load(R.drawable.adroid).into(imageView);
webView=findViewById(R.id.webvidew);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("Add the link of gif here");
Animation Show
ImageView bart=(ImageView)findViewById(R.id.fades);
//ImageView bart1=(ImageView)findViewById(R.id.fades2);
bart.animate().translationXBy(1000f).translationYBy(1000f).rotationBy(360).setDuration(2000);
//bart1.animate().alpha(1f).setDuration(2000);
Auto-Detect-Text
email.setText("maityamit378@gmail.com");
mobile.setText("9856596706");
google.setText("www.google.com");
Linkify.addLinks(email, Linkify.ALL);
Linkify.addLinks(mobile, Linkify.ALL);
Linkify.addLinks(google, Linkify.ALL);
Blink-Text-Animation
ObjectAnimator animator=ObjectAnimator.ofInt(blinkt,"backgroundColor", Color.BLUE,Color.RED,Color.GREEN);
animator.setDuration(500);
animator.setEvaluator(new ArgbEvaluator());
animator.setRepeatCount(Animation.REVERSE);
animator.setRepeatCount(Animation.INFINITE);
animator.start();
Bottom-Nav
implementation 'com.ismaeldivita.chipnavigation:chip-navigation-bar:1.3.4'
<com.ismaeldivita.chipnavigation.ChipNavigationBar
android:id="@+id/bottom_nav_bar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:fadingEdge="horizontal"
android:background="#fff"
app:cnb_menuResource="@menu/nav_menu" />
<item
android:id="@+id/nav_near"
android:icon="@drawable/ic_home_black_24dp"
android:title="Home"
app:cnb_iconColor="#2196F3"
/>
<item
android:id="@+id/nav_new_chat"
android:icon="@drawable/ic_message_black_24dp"
android:title="Message"
app:cnb_iconColor="#F44336"/>
<item
android:id="@+id/nav_profile"
android:icon="@drawable/ic_notifications_black_24dp"
android:title="Notify"
app:cnb_iconColor="#4CAF50"/>
<item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_person_black_24dp"
android:title="Profile"
app:cnb_iconColor="#FF9800"/>
Brain Training Application (Calculation Expert)
Brightness-Management
int cbrightness= Settings.System.getInt(getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,0);
textView.setText(cbrightness+"/255");
seekBar.setProgress(cbrightness);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@RequiresApi(api= Build.VERSION_CODES.M)
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
Context context=getApplicationContext();
boolean write=Settings.System.canWrite(context);
if(write){
int sbright=progress*255/255;
textView.setText(sbright+"/255");
Settings.System.putInt(context.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL
);
Settings.System.putInt(context.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,sbright);
}else{
Intent intent=new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
startActivity(intent);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
Capture-Screenshot
Button click;
private static final int REQUEST_EXTERNAL_STORAGe=1;
private static String[] permissionstorage={Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
click = findViewById(R.id.clickme);
verifystoragepermissions(this);
//adding beep sound
final MediaPlayer mediaPlayer=MediaPlayer.create(this, R.raw.beep);
click.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this,"You just Captured a Screenshot," +
" Open Gallery/ File Storage to view your captured Screenshot",Toast.LENGTH_SHORT).show();
screenshot(getWindow().getDecorView().getRootView(),"result");
mediaPlayer.start();
}
});
}
protected static File screenshot(View view,String filename) {
Date date = new Date();
//Here we are initialising the format of our image name
CharSequence format = android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", date);
try {
//Initialising the directory of storage
String dirpath = Environment.getExternalStorageDirectory()+"";
File file = new File(dirpath);
if(!file.exists()){
boolean mkdir=file.mkdir();
}
//File name
String path=dirpath + "/" + filename + "-" + format + ".jpeg";
view.setDrawingCacheEnabled(true);
Bitmap bitmap=Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
File imageurl=new File(path);
FileOutputStream outputStream=new FileOutputStream(imageurl);
bitmap.compress(Bitmap.CompressFormat.JPEG,50,outputStream);
outputStream.flush();
outputStream.close();
return imageurl;
}catch (FileNotFoundException io){
io.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
return null;
}
//verifying if storage permission is given or not
public static void verifystoragepermissions(Activity activity){
int permissions= ActivityCompat.checkSelfPermission(activity,Manifest.permission.WRITE_EXTERNAL_STORAGE);
//If storage permission is not given then request for External Storage Permission
if(permissions!= PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(activity,permissionstorage,REQUEST_EXTERNAL_STORAGe);
}
}
Circular-Dialog
implementation 'com.github.hassanusman:CircularDialogs:1.2'
new CDialog(MainActivity.this).createAlert("Geeks For Geeks",
CDConstants.SUCCESS, // Type of dialog
CDConstants.LARGE) // size of dialog
.setAnimation(CDConstants.SCALE_FROM_BOTTOM_TO_TOP) // Animation for enter/exit
.setDuration(2000) // in milliseconds
.setTextSize(CDConstants.LARGE_TEXT_SIZE) // CDConstants.LARGE_TEXT_SIZE, CDConstants.NORMAL_TEXT_SIZE
.show();
Colorful-Shadow
implementation 'com.yinglan.shadowimageview:shadowimageview:1.0.4'
<com.yinglan.shadowimageview.ShadowImageView
android:id="@+id/shadow"
android:layout_width="300dp"
android:layout_height="300dp"
app:shadowRound="20dp"
app:shadowSrc="@mipmap/ic_launcher_round"
app:shadowColor="@color/colorAccent"/>
shadow=findViewById(R.id.shadow);
shadow.setImageResource(R.mipmap.ic_launcher);
Contextual-Menu
``` public class MainActivity extends AppCompatActivity { private ActionMode mActionMode;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView textView = findViewById(R.id.text_view);
textView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if (mActionMode != null) {
return false;
}
mActionMode = startSupportActionMode(mActionModeCallback);
return true;
}
});
}
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
mode.getMenuInflater().inflate(R.menu.e_menu, menu);
mode.setTitle("Choose your option");
return true;
}
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
return false;
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()) {
case R.id.option_1:
Toast.makeText(MainActivity.this, "Opt
$ claude mcp add Android-Projects \
-- python -m otcore.mcp_server <graph>