• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Greyed out photos

I'm having the same problem. I got this phone last year may and started saving my photos taken to the sd card. A few months later within the same year I noticed my pics are grey..some more than others. I would really like some feedback as I've got some really important(to me)stuff on it. And yes, i did back up to the cloud however the same thing happened to the pics in the cloud. Grateful for any assistance.

Attachments

  • 20190826_145548.jpg
    20190826_145548.jpg
    97.1 KB · Views: 169

SQLite to pdf doesnt work

I watched youtube vid for basic example of SQLite to pdf file... but the table was created in the MainActivity instead of the databasehelper. I moved it to the dbhelper class, and the insert data functions work fine, but when I try to create the pdf and display the string in the textView box as well, it crashes...
android studio isn't showing any red for errors and it compiles fine, the mainactivity opens fine, inserting data works fine, its only when I try to create the pdf that it crashes... any help is appreciated!

Here is my mainactivity and dbhelper files:

Code:
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Paint;
import android.graphics.pdf.PdfDocument;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Button;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;

public class MainActivity extends AppCompatActivity {

    mySQLiteDBHandler sqlLiteDBHandler;
    EditText editTextSerialNumberInsert;
    EditText editTextSerialNumberFetch;
    EditText editTextInsert;
    TextView textViewDisplay;
    Button btnInsertUpdate;

    SQLiteDatabase sqLiteDatabase;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        sqlLiteDBHandler = new mySQLiteDBHandler(null,null,null,1);
        ActivityCompat.requestPermissions(this,new String[]{READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE}, PackageManager.PERMISSION_GRANTED);

        sqLiteDatabase = sqlLiteDBHandler.getWritableDatabase();

        editTextSerialNumberInsert = findViewById(R.id.editText1);
        editTextInsert = findViewById(R.id.editText2);
        editTextSerialNumberFetch = findViewById(R.id.editText3);
        textViewDisplay = findViewById(R.id.textView1);
        btnInsertUpdate = findViewById(R.id.btn_insert);
        InsertUpdateData();
    }
    
    public void InsertUpdateData() {
        btnInsertUpdate.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        boolean isUpdate = sqlLiteDBHandler.insertUpdateData(editTextSerialNumberInsert.getText().toString(),
                                editTextInsert.getText().toString());
                        if(isUpdate == true)
                            Toast.makeText(MainActivity.this,"Data Updated",Toast.LENGTH_LONG).show();
                        else
                            Toast.makeText(MainActivity.this,"Something went wrong!",Toast.LENGTH_LONG).show();
                    }
                }
        );
    }
    
    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    public void CreatePDF(View view){
        String query = "Select Text from PDFTable where SerialNumber=" + editTextSerialNumberFetch.getText().toString();
        Cursor cursor = sqLiteDatabase.rawQuery(query,null);
        try{
            cursor.moveToFirst();
            textViewDisplay.setText(cursor.getString(0));
        }
        catch (Exception e){
            e.printStackTrace();
            textViewDisplay.setText("uh-oh..");
            return;
        }

        PdfDocument pdfDocument = new PdfDocument();
        PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(300,600,1).create();
        PdfDocument.Page page = pdfDocument.startPage(pageInfo);

        page.getCanvas().drawText(cursor.getString(0),10,25, new Paint());
        pdfDocument.finishPage(page);

        String filePath = Environment.getExternalStorageDirectory().getPath()+"/Download/"+editTextSerialNumberFetch.getText().toString()+".pdf";
        File file = new File(filePath);

        try {
            pdfDocument.writeTo(new FileOutputStream(file));
        } catch (IOException e) {
            e.printStackTrace();
        }
        pdfDocument.close();
    }
}


AND THIS IS THE mySQLiteDBHandler.java file:

Code:
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
import static android.content.ContentValues.*;

public class mySQLiteDBHandler extends SQLiteOpenHelper {
    public static final String DATABASE_NAME = "PDFDatabase.db";
    public static final String TABLE_NAME = "PDFTable";
    public static final String COL_1 = "SerialNumber";
    public static final String COL_2 = "Text";

    public mySQLiteDBHandler(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
       super(context, name, factory, 1);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table " + TABLE_NAME +" (SERIALNUMBER TEXT,TEXT TEXT)");

    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }

    public boolean insertUpdateData(String serialnumber,String text) {
        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues contentValues = new ContentValues();
        contentValues.put(COL_1,serialnumber);
        contentValues.put(COL_2,text);
        db.update(TABLE_NAME, contentValues, "SERIALNUMBER = ?", new String[] {serialnumber});
        return true;
    }
}

Android auto help

I HATE ANDROID AUTO in my new 2020 chevy. I hate having to use a usb cable. All I want to do is take my phone call, make a phone call and be notified of texts. GM got sucked into android auto and apple auto and it sucks. Hell, now my text messages are broadcast load and clear even if I am in a store. What the heck.

Is a HALF-STITCH of Gear360 video possible?

If you watch a Gear360 video before the two fish-eye circle frames are stitched, you realize that it is easier and more enjoyable to watch the front and back views simultaneously rather than rotating the 360 sphere view that results from stitching. I would like to stitch ONLY the left edge of the one circle to the right edge of the right circle creating a flat video showing both front and rear views in the same frame.

I like to put my Gear360 on a selfie stick and walk through a scene. Merging the front and rear camera views of the Gear360 makes for a great way to give the viewer much more information than requiring him/her to rotate the scene in a 360 viewer.

So, is there a way to only stitch half of a two-camera 360 view so I remains a normal video file that does not require a 360 viewer? [GALLERY=media, 377]Half-stitch by NYCPaull posted May 2, 2020 at 10:58 AM[/GALLERY]

Can I separate audiobooks and music?

I was looking for something that could stop "Android Players" (when in shuffle mode), from playing my Audio-books too.
I would have thought that decent ideas from one system (like iTunes being able to ignore Audio-books during shuffle mode), would be added to programs on another system (Android Media Players, or Windows without installing iTunes itself on) by someone that programs those media players, and visa versa?
I am amazed that nobody has done so yet. First one to do it will probably make a fortune as all the people looking for that to happen will transfer to that media player even if it cost a few quid to buy, rather than being free like iTunes and other such players on Android and Windows. iTunes must be looking at the files themselves to do it's sorting by looking at the metadata and noticing that some are Audio-books and others are not. I'm no programmer but there must be a way to make Android Players look at the same data and do that too?

Help Note 9 issue after weekly restart

What application are you running when you see this toast message?

Or does it pop up randomly with any app you are using?

I have only seen such a message if I am using a memory intensive app, and something running in the background stops due to the system shutting it down to distribute memory to the new app.

Example (from a 1GB device that I have):
I use a firewall app that runs all the time.
If I start a game called Narcos: Cartel Wars, it will often make the system close the firewall app.

This will cause a similar message to appear, because the firewall is designed to run constantly, yet the system has closed it.

Do you have any user apps that are supposed to run constantly- that could be getting shut down while using other apps?
I finally fixed it very early this morning...turns out it was caused by me turning off an overlay for a custom navigation bar app yesterday. I needed to turn off an overlay due to a Chrome issue I was having where I was unable to select an answer to a permissions request - I was in a hurry so I turned off all overlays and didn't get around to debugging it properly lol! Thanks anyway for attempting to assist!

Max watts charge a Note 5 can take

I have 2 Note 5s and a Tesla Model 3 with two 7.5 w USB ports into which I want to install a wireless phone charger which can charge both phones at the same time with 7.5 watts to each phone. Tesla also has two other 7.5 watt USB port which I can also connect to that same phone charger to deliver 15 watts per phone. My question is what is the maximum amount of wattage my Note 5s can' accept?

Filter

Back
Top Bottom