The title is the question, but here's a little background:
I'm making a task manager app for Android and want the user to be able to cross out tasks as they complete them onLongClick, without having to delete the task(which is already another feature). Normally, the user creates a task and I send the title, description and timeline to Firebase from that activity. Everything updates and all is well. The user can also edit and change any field in a separate activity and I am able to update Firebase just fine from that as well.
My Problem: I have it where it can successfully strikethrough the task title text for the user in my recyclerview that shows all the tasks. As soon as I push the update to Firebase, it changes the text to "androidx.appcompat.widget.AppCompatTextView{c33...", which overwrites the original text.
Without updating Firebase
After updating Firebase
I'm not sure if what I want to do is even possible. If I simply cant strikeout text and store it on my database, what would be another good alternative to accomplish the same thing? I was thinking of just changing the timeline text to "complete" or something. I just prefer the strikethrough because it looks better to me and avoids having to open the task and manually edit the time.
Databases, in general, do not store formatted text. They just store plain text. If you have some condition that you want to use to determine if text should be formatted in some way (like strikethrough), then I suggset storing another field, along with the text, that your code can use to determine how to format it. In your case, a boolean field for "complete" would be all you really need.
Related
I am making an Android app in combination with a Symfony api. I use Retrofit and Room Library.
Now when I add data to the database, I navigate to another activity. Now I want to show inside this activity a toast with a message that the insertion was done successfull. How can I make sure that only a toast is shown when data is added successfull and not everytime I open the activity?
Unfortunately you need state. You need to remember what has been shown to the user already and - well - not show it if this is the case.
Having said that - I don't believe there are shortcuts. You will not get this feature for free. There will be a bit of work involved, so let's try to minimize that.
I'd probably make a counter on the device side which last message has been shown to the user. I would set the counter to the id of the last message shown. Then you would only need to always increment the counter on the server side.
This is only one way to tackle the problem. There are many others.
Basically i'm working on android apps using hybrid cross platform frame work (angular- cordova) , I want to update the user screens without their knowledge or without updating app, like for example if we change and supply the screens in the back-end, apps screens should get updated.
Currently we have app update mechanism which we want to replace .
For reference example like Facebook screens get changed with out app update or user knowledge .
same way we want to do , any one please give some solution .
Or if their are better way please suggest me.
Many thanks to all.
I am not using but I heard about Silent Push Notification, google it about Silent push notification for your framework.
User don't have any knowledge about getting any notification and you can do your work like layout changing
Example
https://www.google.co.in/search?q=silent+push+notification+cordova
First you need to get UI from server.in server you need boolean variable like changes true or false if change true then you get UI from server and create a view dynamically.Like you get button from server,server side define button colour style and all property then get response from server in conditional statement like you check a response name is button then you create a button dynamically with setTag attribute.and you need to store response from database.You use any database like realm,sqlite and check every response all time like changed=true or false if true then you create dynamical UI and remove old database and add new server response to database
For example I expect this kind of situation: data in my application lost relevance and so it usless until update. And until update it have to show users some predefined message.
Is here any simple and free solution to this task?
Guess I can use some server to somehow send simple messages... but it sounds way too complicated.
If this is important I use Xamarin.
Update: main difficulty here is fact - my application can't in any way define if it's outdated or not. This may happen in random moment.
Although the requirement is not very clear I assume Update here means app update.
each time user launches app make call to an api on ur server to check if user needs to update app
If that returns true take user to a static view that says app needs update and redirects user to google play to install updates
If you want to avoid using a server, you should try Firebase (https://firebase.google.com/). More specifically, you should use Firebase Remote Config (https://firebase.google.com/features/remote-config/).
Define in a key-value pair of something like minimum_app_version_required in Firebase Remote Config. Every time user opens the your app, compare the values of app version and minimum_app_version_required that you are getting from Firebase console and show a dialog box accordingly. You can also change the value of minimum_app_version_required anytime you want.
Just set some internal flag. That when that situation occurs, you can set the flag to true and just edit whatever layout element you are using such as listView or any other element with your predefined messages saved in strings.xml. You can also build any custom pop up screen, depends how you want to show them. Let me know if you didn't understand or exactly how you want?
Need to implement versioning for this problem. To achieve this, you have to maintain a version number in server, this is the version number you app will have to save and use it to validate with server. If both are not same, then app will get the latest data from the server.
I'm currently working on my first serious app., and I would like to have some sort of contol on the data that users can enter.
Specifically, my app. allows users to write some text content (imagine something like a 'tweet'), and upload pictures.
I would like to prevent them from writing inappropriate text, and uploading offensive pictures for instance.
What I thought of doing, is to allow something like 'report abuse' button, where users who find some content offesive, can press - in which case relevent data will be saved, and later checked, to decide if indeed an inappropriate usage happened (maybe by some sort of server-side code).
As I said, I'm a beginner in android development, and I would really love to hear your suggestions and guiding. Perhaps it is something over my league for now? Maybe you know of such thing that already exists?
My app. uses Parse.com as its DB.
I would really appriciate your help.
Thank you.
I'm developing as well an app with parse and I also had to integrate in it a report button for the user.
The way I did it is simple:
In every Pf User object, I created a field of type counter named "reportCounter" while in the PFObject created by the user (it can be a string, a picture, etc.)I created a boolean field named "isReported". When a user find some inappropriate content he can report it through the dedicated button. The PFObject relative to that content gets its isReported field changed to YES and a parse background job checks every day for all the PFObjects, incrementing the reportCounter field of the owner-creator of the content and sending a report e-mail to the administrator. In this way you can keep also a record to see if a particular user is behaving badly. Just take a look at the Parse documentation about background-jobs. It's pretty good.
I hope this will help.
I have an activity with a textview that shows different quotes every time the previous or backward button is pressed. It'd be really funny if I add 10000 quotes in the arrays.xml file and then pass it through to the textview.
Is there any method using which I can, extract text from my own blog and show quote sin the text view. what I mean is, I don't have to prompt the users to update the entire application and just do an update on the cloud and it gets updated in the app every time the user connects to the app.
Just try parsing your xml feed and show that contents into the textview. You can also use a text file and show contents of it using different indexes.
Have you had a look at the Google Cloud Messaging (GCM) service to see if this can help you? I've never looked at it, just thought I'd read somewhere about other developers that have!