Skip to main content

Sqlite Database With Cursor Adapter in Android








First Create Database Helper :



now in your first layout : res/main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <ListView
    android:layout_height="fill_parent"
    android:id="@+id/@android:list"
    android:layout_width="fill_parent"></ListView>
</LinearLayout>

second layout for insert Values: res/inslayout.xml

<?xml version="1.0" encoding="UTF-8"?>
    <RelativeLayout android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
   
        <EditText android:hint="Enter Your Name"
       
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_marginTop="14dp"
        android:layout_alignParentRight="true"
        android:id="@+id/insName">
            <requestFocus></requestFocus>
        </EditText>
       
        <EditText android:hint="Enter Your Number"
        android:layout_width="wrap_content"
        android:inputType="phone"
        android:layout_height="wrap_content"
        android:layout_below="@+id/insName"
        android:layout_alignParentLeft="true"
        android:layout_marginTop="17dp"
        android:layout_alignParentRight="true"
        android:id="@+id/insNumber"></EditText>
       
        <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/insNumber"
        android:layout_alignParentLeft="true"
        android:text="@string/Add_User"
        android:id="@+id/insBtn"></Button>
       
        <Button android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/insBtn"
        android:layout_alignParentRight="true"
        android:id="@+id/insCancel"
        android:text="@string/Cancle"></Button>
       
    </RelativeLayout>

now third Layout for Edit Values : res/editlayout.xml

<?xml version="1.0" encoding="UTF-8"?>
    <RelativeLayout android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">
        <EditText
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_marginTop="15dp"
        android:layout_alignParentRight="true"
        android:id="@+id/Ename">
            <requestFocus></requestFocus>
        </EditText>
        <EditText
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:inputType="phone"
        android:layout_below="@+id/Ename"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:id="@+id/Enumber">
           
        </EditText>
        <Button
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_below="@+id/Enumber"
        android:layout_alignParentLeft="true"
        android:id="@+id/Eok"
        android:text="@string/OK"></Button>
        <Button
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_below="@+id/Enumber"
        android:layout_alignParentRight="true"
        android:id="@+id/Ecancle"
        android:text="@string/Cancle"></Button>
        <Button
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignTop="@+id/Ecancle"
        android:layout_centerHorizontal="true"
        android:id="@+id/EDelete"
        android:text="@string/Delete"></Button>
    </RelativeLayout>

now in your main Activity :


Comments

Popular posts from this blog

Stop Babysitting your AI Coding Agent Every Single Session

  Watched a video by DSquaredLabs on " No more re-explaining: Give your AI agent a memory graph " — here's what stuck with me and why I think this three-tool system is worth your attention If you work on a large codebase with AI coding tools, you already know the ritual. Open a new chat, paste your file structure, explain your stack, describe how the modules connect — and repeat the whole thing tomorrow. It is not a minor inconvenience. It is a compounding productivity tax that gets worse as your project grows. This article breaks down a three-tool system designed to fix exactly that. If you want the full walkthrough with a live demo on a real monorepo, the video at the bottom covers everything in depth — but the core concepts are worth understanding before you dive in. The Problem With How Most Developers Use AI Today Most AI-assisted coding workflows are missing three things that every good engineering team actually has: A map of the codebase A process for how w...

Android - Notifications - 3 (Applying a big view style to a notification)

Big picture style Bitmap icon1 = BitmapFactory.decodeResource(getResources(), R.drawable.dhaval1); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder( this).setAutoCancel(true) .setContentTitle("DJ-Android notification") .setSmallIcon(R.drawable.ic_launcher).setLargeIcon(icon1) .setContentText("Hello World!"); NotificationCompat.BigPictureStyle bigPicStyle = new NotificationCompat.BigPictureStyle(); bigPicStyle.bigPicture(icon1); bigPicStyle.setBigContentTitle("Dhaval Sodha Parmar"); mBuilder.setStyle(bigPicStyle); // Creates an explicit intent for an Activity in your app Intent resultIntent = new Intent(this, testActivity.class); // The stack builder object will contain an artificial ba...

Don't Ship AI Agent Skills Without Evals

At the AI Engineer World's Fair on July 1, 2026, Philipp Schmid, a Staff Engineer on the Gemini API and agents team at Google DeepMind, asked a room full of engineers a simple question: who uses skills with their coding agents? Every hand went up. Who has evals for those skills? Almost none. That gap is the entire talk, which Schmid also wrote up on his own blog, philschmid.de/testing-skills . His team indexed the skills ecosystem through SkillsBench and found the same pattern everywhere: people ship a SKILL.md file after two manual test runs and move on. It looks fine in a demo. It quietly corrupts outputs in production, because bad skills don't crash. They just make the agent confidently wrong. If you've already read our breakdown of Matt Pocock's Claude Code skills library , think of this as the other half of that story: what happens once you've installed a skill and it's actually running against real prompts. Key Takeaways SkillsBench indexed 47,000+ un...