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

Apps Inifite Step Counter app

To persist the step count across device reboots, you can use shared preferences to store the total step count.

Here is an example of how you can implement this:

Code:
// Get an instance of shared preferences
val sharedPreferences = getSharedPreferences("STEP_COUNTER_PREFS", Context.MODE_PRIVATE)

// Get the current total step count from shared preferences
val totalSteps = sharedPreferences.getInt("TOTAL_STEPS", 0)

// Register the step counter sensor listener
sensorManager.registerListener(object : SensorEventListener {
  override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) {}

  override fun onSensorChanged(event: SensorEvent?) {
    // Increment the total step count by the number of steps taken
    totalSteps += event?.values?.get(0)?.toInt() ?: 0

    // Save the updated total step count to shared preferences
    sharedPreferences.edit().putInt("TOTAL_STEPS", totalSteps).apply()
  }
}, stepSensor, SensorManager.SENSOR_DELAY_UI)

This code will read the current total step count from shared preferences when the app starts, and then use a sensor listener to increment the total step count every time the step sensor fires an event. The updated total step count is then saved back to shared preferences.

This way, the total step count will be persisted across device reboots, and you can retrieve the current total step count from shared preferences at any time by calling getInt("TOTAL_STEPS").

I hope this helps! Let me know if you have any questions.

Android BLE write data on multiple BLE h/w simultaneously

In order to write data to multiple BLE devices simultaneously, you will need to write to each device in turn using separate BluetoothGatt objects.

You can do this by creating a separate BluetoothGatt object for each device, and then using the writeCharacteristic method on each BluetoothGatt object to write data to the corresponding device.

Here is an example of how you might write data to multiple BLE devices simultaneously:

Code:
for (int i = 0; i < numDevices; i++) {
  BluetoothGatt gatt = mBluetoothGatt[i];
  BluetoothGattCharacteristic charac = btWriteGattChar[i];
  charac.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE);
  charac.setValue(dat);
  gatt.writeCharacteristic(charac);
}

Note that writing to multiple BLE devices simultaneously may take longer than writing to a single device, as each write operation will need to be performed in sequence. You may need to adjust your code to account for this.

It's also worth noting that some BLE devices may not support concurrent write operations, in which case you may need to implement some kind of queueing mechanism to ensure that writes are performed in the correct order.

React Native Android build failing with 'compileDebugJavaWithJavac' on several packages

There are a few other things you can try if you are still having issues with the build failing:

  1. Try running react-native run-android from the command line to see if there are any additional error messages that can help identify the issue.

  2. Make sure that you have the latest version of the Android SDK and build tools installed. You can check for updates in the Android Studio SDK Manager.

  3. Make sure that you have the correct version of the Android Support Repository and Google Repository dependencies installed. You can check for updates in the Android Studio SDK Manager.

  4. Try deleting the node_modules directory and running npm install or yarn install again to make sure all of your dependencies are up to date.

  5. If you have recently updated any dependencies or libraries, it is possible that there may be compatibility issues. You can try downgrading to a previous version of the dependency to see if that resolves the issue.

  6. If none of the above steps help, you can try cleaning the project by going to "Build > Clean Project" in Android Studio.
It is also a good idea to check the React Native documentation and the documentation for any libraries you are using to see if there are any known issues or breaking changes that may be causing the build to fail.

Need Help Please

To create a balance and inventory system for your fake bank app, you can follow these steps:

  1. Create a class to represent the items that can be purchased. This class should include variables to store the name, price, and any other relevant information about the item. For example:
Code:
class Item {
  private String name;
  private int price;
  // Other variables and methods
}

  1. Create a class to represent the user's balance and inventory. This class should include a variable to store the user's balance, and a list to store the items that the user has purchased. For example:
Code:
class User {
  private int balance;
  private List<Item> inventory;
 
  // Constructor to initialize balance and inventory
  public User(int balance) {
    this.balance = balance;
    this.inventory = new ArrayList<>();
  }
 
  // Method to purchase an item
  public void buyItem(Item item) {
    if (item.getPrice() <= balance) {
      balance -= item.getPrice();
      inventory.add(item);
    } else {
      // Insufficient funds
    }
  }
 
  // Other methods to get balance and inventory
}

  1. In your app's main activity, create an instance of the User class and initialize it with the starting balance. You can then use the buyItem() method to allow the user to purchase items from the app.

  2. To display the user's balance and inventory, you can create a separate activity or fragment to show this information. You can use a RecyclerView to display the items in the user's inventory, and display the balance using a TextView or similar widget.
I hope this helps! Let me know if you have any questions.

Valu Event listener being skipped for firebase database

It looks like the issue is with the requestitems ArrayList, which is being used to store the Requestitem objects that are retrieved from the database. This ArrayList is being passed to the RequestAdapter as the data source, but it has not been initialized.

To fix this, you can initialize the requestitems ArrayList before the ValueEventListener is added. This will ensure that the ArrayList is not null when the data is being added to it in the onDataChange() method.

Try adding this line at the beginning of the onViewCreated() method:

Code:
requestitems = new ArrayList<>();

This will create a new empty ArrayList and assign it to the requestitems variable. The ValueEventListener will then be able to add items to the ArrayList without encountering a null pointer exception.

I hope this helps! Let me know if you have any questions or if you need further assistance.

Microsoft word edit doc

Seriously! I edit a document year round for gifts I find & hide for special occasions; as well as a record of my volunteer work. My Darling Bride keeps schedules of upcoming fly fishing outings, and who knows what else. Neither of us feel a need to grab the other's phone and start digging. If we do, there's a trust issue that we need to resolve quickly.

MetroPCS greatly increased phone prices. Why?

Where are you seeing these prices? Looking on tne Metro site the prices on those phones are much lower than your numbers here and there are deals that can make them very cheap or even free (new customer or adding a new line to an existing account).
As stated you do have BYOD as an option. In addition to buying new from Amazon, Best Buy etc. you may also want to check out the offerings on Swappa. New and used devices are available there at good prices.

Can someone help please

Exactly - it sounds like there's already a high level of distrust in the relationship. There is a reason he doesn't trust you, and you don't trust him. That needs correcting, with counseling and lots of open communication, or else the best thing to do (as painful as it is in the short term) is to agree to part ways amicably. (This is advice from an old Navy Chief who just passed 32 years of marriage) Just sayin'

Help Mysterious "Crown" App Symbol (most likely android) - Help for identification

I don't know what an "action bar" is, though this looks like a notification. Does it appear on the right (typically system notifications) or left (app notifications)?

The problem is that there are literally millions of apps, so unless this is a well-known one the odds of anyone reading this knowing what it is are slim. If this is on your own phone pull the notification slide down and you'll be able to see what it is. If, as is more common with these queries, it's on someone else's and you've just seen it in a screenshot, the simplest answer will be to ask the person whose phone it is. You could try a reverse image search on the image you've uploaded and see whether that finds anything.

If you want my guesses, games and gambling apps are the first things I think of when I see this, but it could be almost anything.

Everything wrong with the Galaxy S6 Edge UI / Android 5.1.1 Lollipop UI

I've had my 128GB Galaxy S6 Edge for a few days now, and I've come across several issues regarding specific software design choices - some of which are unique to the S6 Edge, while others I feel are down to Android Lollipop (v5.1.1). Many of the changes from KitKat to Lollipop feel unnecessary, and there are several instances where features found in earlier versions are missing or do not operate in the same way

Below I will list the nine major issues I have experienced with my S6 Edge, which I feel could be improved. Some are just personal preferences, while others are features we have been used to in the last few software versions, and which I feel should not have been changed.

1) Central button and Menu Key operations switched - For some reason or another, somebody thought it would be a great idea to switch how the central button and left Menu button operate. This is perhaps the biggest change I noticed straight away, and also the one which frustrates me the most! There was no reason to mess with this after six years, and I would like to see these buttons switched back! Alternatively, an option to switch back to the "classic" style

2) eMail client - Probably my most used feature of my phone, the eMail client on the S6 Edge (Lollipop v5.1.1) is terrible compared to that of previous Android versions like KitKat and JellyBean. The white and grey colourscheme is not great, and makes the client unusable (why is there no option to change the colours to dark?), and hurts my eyes to look at it too long! There doesn't seem to be an option to select multiple eMails at once (Ie, a "Select all" option), and eMails are no longer divided by the days they were received. Two huge oversights! There was nothing wrong with the KitKat eMail client user interface, and I get the impression that it was only changed for the sake of change. A step in the wrong direction here I feel, especially when we have been used to something far superior until now!

3) Night Clock - A clock on the S6 Edge screen. A great idea! Saves battery power, and means we can have a clock visible all the time. But wait - some bright spark decided that you can only use this feature at night! WHY!? Why is this not a permanent feature available for 24 hours of the day?

Also, why is there no option to choose its position? The only option available is left or right. Wow! I would prefer an option to be able to centralise the information displayed on the S6 Edge screen, as it appears to be off-centre!

4) Volume settings - Why do Music, Video, and Games not all have separate volume options? After all these years and we still have to suffer having to turn the music volume up, and volume back down whenever we want to watch a YouTube video or play a game. It's about time Google implemented this distinction between different kinds of media!

5) Music Player - Not too keen on the new Music Player design, and much prefer the version as seen with KitKat. Another case of "if it ain't broke...", but they fiddled with it anyway! I would very much like an option to view track titles only without the artwork taking up valuable space in the left column. There's so much unnecessary wasted space with this new-look Music Player UI, and I just want to view a list of track titles, and preferably more than seven on screen at once!

6) Home screen swiping - Why can't we swipe to the left!? Why can't we cycle through our home screens like before? Instead a conscious decision was made to add Flipboard to the left, rather than allowing us to quickly flick in the opposite direction! I would like to see a return to the way things were, as it frustrates the hell out of me having to flick in just one direction!

7) Lock Screen - Gone is the cool ripple effect, replaced by a not so effective bubble effect. Why remove the old effect? Was there any need to replace it outright, rather than just giving us an additional choice? Would like to see the old ripple effect return as an option. It would also be nice to be able to set a personalised audio sound / tone to the unlock, rather than sounding like a wet fart in a bath

Also gone are the lock screen app shortcuts, with only Camera and Phone being the only two which can be selected by default, with no option to change these. I guess this has been replaced by the S6 Edge "Apps Edge" feature, which is a reasonable compromise I guess

8) Menu & Back keys - No option to keep the Menu or Back keys lit up, like on older software versions. Would like to see this option re-added

9) Camera - There seriously needs to be an option to turn off certain sensors for taking a snap, especially that selfie sensor on the back of the handset! Why is there no option to turn this sensor off?

10) Gallery sorting - It infuriates me that there is no option to sort Gallery images alphabetically. Images are generally displayed in chronological order as per meta data, which is annoying when you have hundreds of images stored which you have taken the time to name in alphabetical order. The main file manager has this option, so why not the Gallery?

I would also like to be able to choose a main cover for album, rather than have the most recent image displayed
All part of streamlining Touchwhiz due to tech reviewers moaning about Touchwiz.

Help How to adjust in call volume

"call volume is controlled by the system setting.">What do you mean? Does adjusting system setting adjust the call volume?
-----
I saw this
xeCx65I.png

source https://www.samsung.com/in/support/mobile-devices/adjusting-the-volume-on-my-samsung-galaxy/

Do you mean adjusting the System higher will have higher in call volume?
System volume can only be adjusted if phone is set to Sound mode.
Pretty much any person on this planet knows this rule of thumb...

Correct password not accepted, phone locked, need help

I've never heard of an android feature that requests a password input every 72 hours.
That's your problem right there.
I hate to say it, but I'm thinking your Gmail account is hacked by this app, which in turn is locked you out of the device because they've already changed the password.....

the 72 hour thing is an in-built feature of Oppo and have been like that if you are using alphanumeric password. Same thing with my Huawei phone. Samsung don't have that one.

Filter

Back
Top Bottom