Using ImageButtons to edit/store data for that specific object - android

so I'm a very new to the android development so please bear with me. I am attempting to create an app that will connect with a database of course listings for students and allow them to select their degree and choose their required courses and which semesters to take them in.
I would like to know how to allow a user to select an ImageButton (which is essentially a course), have it call another activity where they can edit the course information based off of information from the database, and have it return to the original activity with the information for that button stored into it. If anyone can help regarding how I can even approach this that would be great. Thanks in advance!

Use setOnClickListener to bind a click listener to your button. Use startActivityForResult/setResult/onActivityResult to start the next activity/return data/handle data. Here's an older tutorial about doing that.

Related

How to create a dynamic page in an Android app

Recently was given the opportunity to create an Android app for my college group. But I was not satisfied with the event page. I wanted to create a dynamic page in which admin can update the upcoming events. On using URI the images were a bit off. Can anyone help me?
If you want to create Event Page which can be changed dynamically, you should design a page such that, you give a provision of adding Events, displaying it and
refreshing the UI.
I would suggest before start implementing an App, you should gather requirements, define the features of the App, Design the App and then go after implementing.
You can use Firebase storage and Real-time database to store data and images. Also, create an admin application for changing the image.
You can have provision to add an event, persist the event details by using either database or webservice, and updating the event.
The create event page can be made dynamic by having provisions to add/subtract event detail items from the screen. For example: Use can have a section saying Number of day(s) and a + button besides it to add details about each added day.
If you want only admin user to be able to add, update, and delete the event you can use role based login (for login again, you can use either database or webservice).
These are just rough ideas, but its necessary that you freeze the requirements before jumping into designing the app.

How to Call Remote Method service?

I'm developing in app, in which user can add weather card to know city weather. I'm able to populate cities with Google Places Autocomplete API & also can able to retrieve weather of selected city.
But my problem is as weather data is not fixed, it changes over time. So how can I update weather data in background once user creates that weather card. I need to do updates in background, I think I've to use android service but don't know where to start.
Ok, I will only guide you here,Nobody will provide you full code neither i will recommend anybody to do so, It is for your own good. You need to practice and explore the android programming world. So, here is my guidelines for you.
FirebaseJobDispatcher will fix you problem here. Before moving towards the FirebaseJobDispatcher you need to create a service class. For Services in android you should check this out.
Lets Talk about your service class.
Lets say it is FetchWeatherData class FetchWeatherData will extend to IntentService and will implement some methods. Inside onCreate you will write logic for fetching data from the server. Once you get the data from server you will store into the Database. Before storing into database you should check if database have the any record in it? If it does then delete it and store the new records in it.
Lets Talk about your Activity. Lets say it is ShowWeatherActivity. You will check first if you have any record in your database if there is no record then you will use FetchWeatherData to download weather data. Then show it.
Answer to your question can be very lengthy but i tried to explain as much which can help you get the idea of sync flow. Ofcourse your problem won't solve by reading this answer only. You need to go through these concepts
Services (Runs on main Thread)
Intent-Services (Runs in background)
Sqlite (For storing data)
I have added the helpful links in answer. Follow them. I hope this will help you somewhat.

Android: how to integrate a 'report abuse' mechanism in my app.?

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.

How to create message and save it in Android?

i am trying to develop a simple application. i want to create a simple message and want to save it. now, i want to select message from list of messages which i have created and stored.
can any one please suggest me or give an idea for developing the same.
Thanks in Advance
If you substitute the word "message" for "note", you are describing something really similar to the notepad example.
It runs you step by step trough the code you need to make an application that has notes (messages) you can add, and open.
If you are new to Android development you should go trough all the excersises, because it's a really good help, but if you're not you can just download the sollution and use that.
I feel you should go like this:
Have your application store Contacts in a database (I guess you're already doing this)
Have your application store messages in another database (I guess you're already doing this too)
In the UI, display all the messages inside a ListView, by querying them from your message database.
When user clicks on any message, have another screen that loads this message in full, and lets the user select the recipients
Send the text message to the selected recipients now
I just wanted to point out the flow of the app, since the storage and retrieval process os pretty straight forward. I am not sure if this was what you were looking for.
Do let me know.
If you will store little amount of data you can use sharedpreferences
http://developer.android.com/reference/android/content/SharedPreferences.html
If you want a real solution that is sqlite database that comes with android.
http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html

Add a contact to android emulator

My issue is quite simple I think :
I would like to be able to add a contact to the contact list by a simple click on a button (and be able to test it on the emulator). The data of this contact would be stored in the source code of the application.
is there an easy way of doing that?
thank you for your answers
The only easy way to insert a contact is to use an INSERT action, where you supply some of the data and start up an activity for the user to provide the rest and confirm adding it to the contacts list. Here is a sample project demonstrating this.

Categories

Resources