I am currently making an expense tracker on Android Studio. it is my first time so I'm not too experienced and am not expecting a fully coded answer, but maybe some guidance as I have not been able to find any resources online for my particular question.
So I know how to get user input, which in my case would be something like Amount Spent: and Location... etc. The only thing I am not familiar with is how to add/append this data to a table in Android.
For example, the table would look like this:
The user input would then be added to the table depending on the header.
I hope it will be helpful for you although in your post there is a few lack of description
Adding Table rows Dynamically in Android
I am building an Android application, later on maybe also an iOS version of the app and a web application. I have a list, for example in this way:
City Name
State
Counter Clicked
More columns
Dallas
Texas
4
…
Boston
Massachusetts
3
…
New York City
New York
1
…
San Francisco
California
3
…
San Diego
California
3
…
Seattle
Washington
10
…
Boise
Idaho
0
…
I am searching for a solution how to meet the following requirements:
The list and its data are always up to date and transferred from a backend system (Google Firebase) when the user is online.
The solution needs to work on iOS / Android devices and if possible also on a website.
Typing in "D" only "Dallas" should be displayed.
Typing in "S" Seattle, San Diego, and San Francisco should be displayed in this order, because of the "Counter Clicked" value (the higher the value, the more relevant is the result)
Typing in "S" also Dallas, Boston, Boise should be displayed in this order (regarding "Counter Clicked") after the words beginning with "S", because they are containing the letter "S" within the word.
The "Counter Clicked" is handled per user. So the City Name can be selected and every time the user selects the city name, the "counter clicked" should be increased by 1.
The filter service should be offline ready, so the "Counter Clicked" should be handled on the device. I am not quite sure if it makes sense to upload the data back to the Firebase backend server, what do you think?
It would be great to have a typo tolerance. So for example typing "Bostn" or "Sen" (tolerance by one letter) "Boston" or "San …" should be displayed.
I will also have the possibility to have a facet filter so that I can filter before typing for one of the "State"s of the USA.
I am interested in a professional solution if this is available on the market, otherwise, I need to build it for myself.
I am building an Android application, later on maybe also an iOS version of the app and a web application.
You can achieve that using Firebase because:
Firebase is a platform developed by Google for creating mobile (iOS and Android) and web applications.
I am searching for a solution how to meet the following requirements
To answer your questions, I will use Cloud Firestore which is:
Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud. Like Firebase Realtime Database, it keeps your data in-sync across client apps through real-time listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of network latency or Internet connectivity.
Let's get started:
The list and its data are always up to date and transferred from a backend system (Google Firebase) when the user is online.
You have the answer right above, "it keeps your data in-sync across client apps through realtime listeners". So your data will always up to date.
The solution needs to work on iOS / Android devices and if possible also on a website.
It will, as Firebase is a cross-platform solution.
Typing in "D" only "Dallas" should be displayed.
You can achieve that in a very simple way, by using Query's startAt() method:
Creates and returns a new Query that starts at the provided fields relative to the order of the query.
So you query should look in code like this:
ref.collection("cities").orderBy("cityName").startAt(name).endAt(name + "\uf8ff");
You can also check the docs for that, and see my answer from the following article:
How to filter Firestore data cheaper?
Typing in "S" Seattle, San Diego, and San Francisco should be displayed in this order, because of the "Counter Clicked" value (the higher the value, the more relevant is the result)
To solve this, you can use Query's orderBy(String field, Query.Direction direction) method:
Creates and returns a new Query that's additionally sorted by the specified field, optionally in descending order instead of ascending.
So you can display those cities according to the number of the "Counter Clicked".
Typing in "S" also Dallas, Boston, Boise should be displayed in this order (regarding "Counter Clicked") after the words beginning with "S", because they are containing the letter "S" within the word.
Unfortunately, Firestore does not support full-text search. The official documentation regarding the full-text search in Cloud Firestore is up to date and stands for Algolia.
For Android, please see my answer from the following post:
Is it possible to use Algolia query in FirestoreRecyclerOptions?
Or:
Is there a way to search sub string at Firestore?
The "Counter Clicked" is handled per user. So the City Name can be selected and every time the user selects the city name, the "counter clicked" should be increased by 1.
This can be very simply achieved using FieldValue.increment(1) as explained in my answer from the following post:
What is the recommended way of saving durations in Firestore?
The filter service should be offline ready, so the "Counter Clicked" should be handled on the device. I am not quite sure if it makes sense to upload the data back to the Firebase backend server, what do you think?
According to the official documentation regarding Access data offline:
Cloud Firestore supports offline data persistence.
For Android and iOS, offline persistence is enabled by default.
For the web, offline persistence is disabled by default. To enable persistence, call the enablePersistence method.
So you have support for three platforms, and yes, it makes sense to upload the data to the server because in that way you'll always have consistent data.
It would be great to have a typo tolerance. So for example typing "Bostn" or "Sen" (tolerance by one letter) "Boston" or "San …" should be displayed.
That's nothing built-in Firestore that can help you with that. What you can do, is to create an additional field of type array and search within it. So that array might have typos like that "Bostn" or "Bston".
I will also have the possibility to have a facet filter so that I can filter before typing for one of the "State"s of the USA.
That's also nothing already built-in Firestore, but you can implement for sure something like that. Most likely you might consider defining some filters and use them before typing.
I am interested in a professional solution if this is available on the market, otherwise, I need to build it for myself.
For sure Firebase can help you achieve what you want, so I hope I was able to provide the best solutions for that.
I'm currently working on a native Android app for my company and ran into some problems with Salesforce lately.
I hope I can find some help here.
What I want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)
The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.
The problem I'm facing is that I can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login.
Which API is the best to use in this case?
It would be so awesome if anybody could help me with this problem.
What I tried so far:
- SalesforceMobileSDK: If i extend SalesForceApplication() i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method peekUnauthenticatedRestClient(), but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practical for my Use-case.
I feel like I read nearly all docs about salesforce API, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.
would a salesforce-apex method which would select all records inside a set radius around the user's location to be accessible without authentication?
Thanks for your help in advance!
Roman
Try asking on salesforce.stackexchange.com. Your question is more about licensing model than a particular programming problem. It might even be the case that you don't really need Salesforce for your project, you'd be better off on Heroku (even free tier) if the login piece is an issue...
All Salesforce APIs require some form of authentication. If you're positive you don't want to hardcode "Integration user" credentials in the app and you don't want to pay for (self-)registered user licenses in your org...
Try to read about these:
Site - piece of Visualforce running under specific "guest user", letting you view & interact with SF data without having to log in. You expose SF data to the world but that means it's your job to handle security (if any) and craft the API. You want to really display the data to human? Or just return JSON content or what...
Sites are meant to be displayin some incentive to contact you. Your product catalog / basic order form. Some map of nearby locations. Maybe a "contact us" form. There's limit on the traffic so eventually they'll explode as your app gets popular:
Customer Community - typically you need named licenses (even if they're fairly cheap) to let your customers log in to your SF. You create a Contact, click magic button - boom, this Contact now has a real matching User record with its own license. Think of it as some kind of step up from Sites - it'll still have some limits but will offer more than just raw API access and you'll have better control on what's going on.
I'm currently developing an android app for a weight scale I received that transmits data through bluetooth low energy.
I was looking at documentation and if I got the information correctly, there are specific UUIDs for data. I received a BLE scale with a Chinese protocol document found here: http://www.anj.fyi/protocol.pdf
I found and was able to get a functioning scanner working that lists the device name and the UUIDs it broadcasts.
Lets say I want just the weight data to show up in the UI, nothing else and nothing more.
I don't know what UUID they used for the weight data, and there are a lot of UUIDs. Probably 20+. I checked a UUID compilation and the usual weight data UUID does not show up.
How do I get the data from those UUIDs?
I'm thinking it might be the ones that are notifications, indications or read properties.
Looking at the UUID for example, f000ffc2.
How would I get data from that characteristic? Would anyone have an example code to grab the data from those UUIDs, or tutorials because I'm terribly lost right now.
I really appreciate it.
There are no weight information on the document you list http://www.anj.fyi/protocol.pdf, it is only shows the BLE module hardware interface spec, i.e. it does not specify the detailed service and characteristic.(I an a native Chinese speaker).
Regarding to the UUID you want to know which is the one to represent the weight, yes you are right it should be the read/notification feature without write permission. Can you use the apps e.g. lightblue on iOS to receive the notification(meanwhile change the value on your device) to test it? this will help you to understand which characteristic is the one you want.
I've been using Yahoo! Finance API to fetch stock prices. The XML in the links 1 and 2 have a list of most ticker symbols I would need, but they are jumbled and not sorted based on the stock markets they are associated with (for e.g., I would like to associate Google's ticker symbol 'GOOG' against NASDAQ). Given the total number of companies listed in the XML files, it would be extremely time consuming to try and manually associate them against their stock market.
Is there anyway we can achieve this using code (preferably Java) or is there an available site which does that for us? I have been Googling this for the past couple of days but haven't been able to find anything helpful. Please let me know if anymore details are required.