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

Displaying A Bunch Of Images At Runtime (Left To Right)

Hello,

I have a rather strange application that has a bunch of images (500+) png images under 1kb each. The data will come in as the file name 0001.png, 0002.png, 0003.png etc. that is unknown in advance so they need to be drawn at runtime.

What control should I use to draw the images from left to right top to bottom. The widths change but the height remains the same for all the images.

Thanks in advance!

Paul H

I have a Kyocera hydro shore that I bought new in a 0pen box special. It's an AT&T phone. I had to get a code from them to unlock it so I could use my own sim. It has Android 5.1.1 and I am trying to upgrade to a newer version of Android but everything I try it won't let me update. The update is still saying att is still who does updates but it's unlocked from them so I don't have an account with them. If I could get the phone to boot to the bootloader I can use a custom rom. I have tried holding down all configurations of the buttons but cannot get it to go to where I can load a custom backup changing the Android version. Does anyone have a clue what I'm doing wrong? Please help, Paul H Thanks

SQLite order, group, most recent

I'm trying to see if there is a better way to do this than I'm doing. What I have works, but I have to make several DB queries in a loop to get what I want. I'm wondering if there is a better approach that can do it all in a single query. I've tried some things I found on SO and such, but while they worked for MySQL, they use a syntax SQLite doesn't appear to support.

I have a table "messages" with the following data:
Code:
+----+----------+------------+-----------------+---------------------+---------------------+------+
| id | incoming | contact_id | contact_name    | message             | sent                | seen |
+----+----------+------------+-----------------+---------------------+---------------------+------+
|  1 |        0 |         30 | Cap             | Hi there, Cap       | 2019-01-10 15:07:43 |    0 |
|  2 |        1 |         30 | Cap             | Hey, what's up?     | 2019-01-10 15:27:23 |    0 |
|  3 |        0 |         43 | SorcerorSupreme | Strange night, huh? | 2019-01-10 16:42:18 |    0 |
|  4 |        1 |         37 | IAMGROOT        | I am Groot!         | 2019-01-13 09:24:55 |    0 |
|  5 |        0 |         30 | Cap             | Nothing             | 2019-01-14 02:53:28 |    0 |
+----+----------+------------+-----------------+---------------------+---------------------+------+
id, incoming, contact_id, and seen are int, the rest are text

The goal is to get only the last sent message from each contact. For that, I am using the following two functions:
Code:
public ArrayList<Map<String,Object>> loadConversationList() {
    ArrayList<Map<String,Object>> list = new ArrayList();
    SQLiteDatabase db = getReadableDatabase();
    Log.d(TAG, "Getting list of last messages");
    String sql = "SELECT contact_id, max(sent) AS td FROM " + MESSAGE_TABLE + " GROUP BY contact_id ORDER BY td ASC";
    Cursor res = db.rawQuery(sql, null);
    Log.d(TAG, "Made call");
    res.moveToFirst();
    Log.d(TAG, "Set cursor");
    while (!res.isAfterLast()) {
        int contact_id = res.getInt(res.getColumnIndex("contact_id"));
        String sent = res.getString(res.getColumnIndex("td"));
        Log.d(TAG, "Getting info for "+contact_id+":"+sent);
        Map<String, Object> message = getMessage(contact_id, sent);
        list.add(message);
        res.moveToNext();
    }
    Log.d(TAG, list.toString());
    return list;
}

private Map<String,Object> getMessage(int contact_id, String sent) {
    Map<String,Object> message = new HashMap();
    SQLiteDatabase db = getReadableDatabase();
    String sql = "SELECT * FROM " + MESSAGE_TABLE + " WHERE contact_id=" + contact_id + " AND sent='" + sent + "'";
    Cursor res = db.rawQuery(sql, null);
    res.moveToFirst();
    while (!res.isAfterLast()) {
        message.put("mid", res.getString(res.getColumnIndex("id")));
        message.put("incoming", res.getString(res.getColumnIndex("incoming")));
        message.put("contact_id", res.getString(res.getColumnIndex("contact_id")));
        message.put("contact_name", res.getString(res.getColumnIndex("contact_name")));
        message.put("message", res.getString(res.getColumnIndex("message")));
        message.put("sent", res.getString(res.getColumnIndex("sent")));
        res.moveToNext();
    }
    return message;
}

As I said, this works perfectly - does exactly what I want. I'm just trying to see if there may be a more efficient approach.

BLE password connection

Am using BluetoothLeGatt to communicate with a jaalee beacon. Can connect with the beacon. However, to write characteristics I must connect with a password, 0x666666. After connection, cannot write the password to the characteristic since I did not connect with the password. Typical horse and cart scenario. Been stuck on this awhile, please help a newbie over a hurdle.

Help To continue, give Google Photos access to your photos

(First time poster, apologies if i get this wrong)

I have an issue on my pixel 2 xl, I cannot access my photos because the phone thinks that the photo app doesn't have permissions to access it.

Whenever I try to access photos, even through other apps, I get the message:
"To continue, give Google Photos access to your photos" with a "GO TO SETTINGS" button.

When I go to the settings of the app I have gave it all the available permissions.

Restarting the phone doesn't do anything.
Uninstalling photos app and reinstalling doesn't do anything

I can't think of anything that will fix this, or allow me to get access to my photos.

- I am in the android beta program
- Android version Q
- Build Number: QPP1.190205.018.B4

I'm not sure of what more information is required, but I will try anything to fix this.

Thanks in advance.

Using placeholders with textView

I'm trying to get mybrain around using placeholders with a textView. Instead of simply displaying "VAT" I want to show "VAT at 20%" (or whatever the rate is).

I currently have in my strings.xml

<string name="vat_text">VAT</string>

and in my Java

textView16.setText(R.string.vat_text);

I have changed the entry in strings.xml

<string name="vat_text">VAT at %d</string>

and tried in my Java

textView16.setText(getString(R.string.vat_text, vatPc));

but this gives a runtime error (which I couldn't catch as there were dozens of other errors afterwards.

Touch Sensitivity

Hi,
I am using S10 for past one month. Initially it was okay. But recently I am encountering some problem with my phone's touch response. Sometimes it does not work. Examples can be when I am making an whatsapp call, I can not end the call or do anything on the screen. Touch does not respones. I have to go to drop down menu to end the call. Again it happens when I am searching something from google search app. I am touching to creat or edit, but no response! Is it the problem with the glass protector (it came from the box) or with software?

Phone doesn't recognize pattern, won't unlock

I had Magisk installed, did the following procedure so that I can update to the latest OTA: magisk manager>uninstall>restore images> download and install OTA. Magisk didn't behave like it did before (uninstall button didnt change to install button), and then i restarted my phone.. It booted up normally. went to magisk manager, where it said it wasn't installed. downloaded the newest stable release of magisk, tried to reboot into recovery only to find the pattern screen for decrypting which doesnt recognize my pattern. I have then tried to boot normally, and then the phone didnt recognize the pattern at all, be it normal unlock or decrypt. What do I do? Bootloader unlocked, and I do not want to lose my data. Please give steps, I don't know much about this stuff :c

Help Appreciated - Barcode Scanner data to Excel

Hi guys and gals. I have been charged with learning something completely new to me, and as much as I would like to say I am a quick learner, I find that half the battle is not knowing the question to ask, to get the answer I need. That being said, what I am trying to do seems relatively simple, it's just getting there, so i'll explain what I am trying to do and if someone can aim me in the right direction, it would be very much appreciated.

I have a TC20 barcode scanner, of course Android based. It does not have a standard camera as per most of the phones that are used in various YouTube videos. What you can do on this unit is press a button and it will decode a barcode to whatever field I have selected on whatever app at the time without having to do anything else. I believe there is a background service that constantly runs in the background that handles this.

I want to be able to scan a barcode, and on submission, be it automatically after scanning, or by pressing a submit button, pass that barcode information and a timestamp to a live open database or spreadsheet.

I HAVE been able to get this working following various tutorials into Google Sheets, but I am unable to query live data via Microsoft Access which is the tool of choice in the office (currently).

Thank you for taking the time to look at this post and I apologise in advance if this has been asked hundreds of times before, my limited understanding of how this works means I couldn't find it by directly searching... (back to not knowing the question to ask...)

Media recovery and Rooting my LG G6

I have a LG G6 (LG-H870) with android oreo 8.0.0, kernel version 3.18.71
I want to root in mainly to recover a couple videos I've deleted.
If there is a way to recover the videos without root that would be great, if not then I need some help rooting my device because I've never done it before.
The videos I've deleted were locked and I have "permanantly deleted" them as they don't go in the trash.

I've found this : https://forum.xda-developers.com/lg-g6/development/tool-tool-one-driversunlocktwrpfactory-t3674088

Also, I know that rooting my phone voids my warranty so I was wondering if there was a way to unroot my phone in order to get back my warranty after I'm done recovering my videos/photos?

Basically...
Is there a way to recover deleted videos/images without rooting my device and if not then how do I safely root it?

Help Phone restarts forgets all settings, passwords

Dear all,

I had a very strange thing happening with my phone two days ago. It was in my pocket, together with my other phone, battery was low. I pull the phone out of my pocket and it starts a walkthrough typical for the newly started device, asking for passwords, gmail info, asking for the finger print to be set up from scratch. Because it is my second phone, set up with a random gmail account, I of course lost memory of the account, passwords, everything and I logged in with another gmail account.

The problem is that the phone now is not showing all the apps that were installed and messages and stuff. It forgot everything, including my Samsung account. And of course I cannot remember all the passwords and stuff so I am losing contacts, messages and other stuff like this.

My question is how come this happened, having in mind my phone was locked in my pocket, and does someone else have similar experience? This thing with 100 users and passwords is pising me off.

Bests

Annoying adware

For some reason, I have been noticing full screen ads appearing on my phone for over a month now. They seem to be showing up every minute or so whilst the phone is idle, and I cannot find any source for them whatsoever. I installed Addons detector to see if I could find the culprit, but no success. When I click on the icon within the stupid ad, it contains no info whatsoever, and even displayed whilst I was running an anti adware/malware app.

To be honest, I don't really need these ads appearing on a phone that I paid for in full with no lock in contract. But I haven't found any solution to the problem. The Android version is 5.0

Apart from a factory reinstall, is there way at all to remove this malicious software? I cannot find any rogue apps installed.

Changing android box, Vankyo, from PAL to NTSC?

Hi ,forumites, hope you can help me, just got my android box and when I hook it up to my older CRT TV, it boots up OK< but I have that dreaded rolling black and white screen. I took it into the living room and hooked it up via HDMI and was able to go to display area and drop it down to 480 ( oh, it was in Spanish, what a hassle, had to to the Spanglish shuffle), anyway, took it back into kitchen, still rolling.

So, can someone please help me with a tried and true method to get it over to NTSC from PAL< which I beleive is causing the problem, right, well, will await your expertise, as I have learned to be a bit patient, when I am sure this has happened to others, Thanks for listening, hope you can assist me, RD

NOTE 4 USERS I NEED YOUR HELP.

So my phone screen just recently died I know my phone well enough to put the code in even with a black screen but this is where I need help. If someone could please take step by step screenshots of one plugging a USB in to the computer from the phone it'll ask to connect and media device n other things I'm not sure of immediately but I'm trying to be able to click that so I can transfer my files off of it to the computer but me just clicking around is impossible. My next request is I need step by step screenshots of disabling my pattern password so I can do this a lot easier and try and figure it out on the black screen where I'm touching things. Please and thank you if I need anything else I'll post

Display Photos on Phone or Tablet

I have a number of sets of photos in folders on my Windows PC, and I've copied them to my Galaxy phone (S10) and tablet (Tab A). I'd like to view the photos in one of these folders by just swiping from one to the next. Is there a simple app that will do this? When I've looked at slideshow apps, they seem quite a bit more complex than what I am looking for. I don't want captions, music, smooth transitions or anything like that. I just want something better than clicking on each photo individually to view it.

A question about getRecommendedTimeoutMillis method in AccessibilityManager class

Hello.
In order to test getRecommendedTimeoutMillis method with FLAG_CONTENT_CONTROLS in AccessibilityManager class, I created snackBar.
FLAG_CONTENT_CONTROLS method is android Q API that control timeout function within accessibility service is enabled.
In other words, if default snackBar set to show short, the snackBar is disappeared very shortly.
But if I use snakBar with getRecommendedTimeoutMillis method, once accessibility service such as TalkBack is enabled, blind users can interact with snackBar with more easily.
Because I have Pixel 2 and enrolled android Q beta, I can test new API.
By the way, within my snackBar, I really don't know how to apply getRecommendedTimeoutMillis method to my snackBar.
Actually I'm really new to java, could you help me?
If you can write code include my snackBar code with getRecommendedTimeoutMillis method, I can copy it, past, and test.
My snackBar code is below.

public void snackbarWithAction(View view){
Snackbar snackbar = Snackbar.make(coordinatorLayout,"Snackbar With Action",Snackbar.LENGTH_SHORT);
snackbar.setAction("UNDO", new View.OnClickListener() {
@override
public void onClick(View view) {
Toast.makeText(getApplicationContext(),"Undo action",Toast.LENGTH_SHORT).show();
}
});
snackbar.show();
}

Thank you so much in advance.

What is ODIN LOCKED on New Samsung phones mean?

Well if you ever encountered errors while trying to flash a stock firmware on any new Samsung devices their is such a thing called ODIN LOCKED.

So what is it and what does it do?

Well ODIN locked has no option to unlock it or even possible to show up in the devices bootloader, however samsung decided to uo their security to prevent their devices to be rooted any means neccassary even if your device cannot boot.

What ODIN LOCKED does is block all connections dealing with the AP option in Odin and always receive a Fail when ever odin attempts to flash the firmware.

This is becasue ODIN LOCKED is unknown and developers cannot seem to find the code to fix the problem, so if you receiveed any system updates starting from 2018 and beyond keep in mind firmware flashing is blocked

Filter

Back
Top Bottom