Unable to configure JSON in android studio - java

I'm working on a project. There is a website coded in asp.net and database is SQL. and there is a mobile app connect to this site.in app it used JSON and no db codes. I added new tables to this site and I want to configure it from android studio. I'm new to JSON so I can't config the database from android studio. And I want to know what is a .ashx file is? I can't add code snips due to privacy policy in company. Thank you very much!

.ashx file details:
A file with the ASHX file extension is an ASP.NET Web Handler file that often holds references to other web pages used in an ASP.NET web server application.
The functions in the ASHX file are written in the C# programming language, and sometimes the references are so short that an ASHX file may end up just being a single line of code.
Most people only encounter ASHX files by accident when they try to download a file from a website, like a PDF file. This is because the ASHX file references the PDF file to send it to the browser for download but doesn't name it correctly, attaching .ASHX at the end instead of .PDF.
source: https://www.lifewire.com/ashx-file-2619693
And as far as I think for accessing JSON in the android studio you can look into volley.
Volley Documentation: https://developer.android.com/training/volley

Related

Retrieving data from web browser's download manager using java

I want to try creating a program that can automate the storing of web address that is available on every downloaded file on a web browser.
My problem is I don't know where to start.
What am I planning to do is just save all the downloaded file's web addresses in a excel file.
Sample image using google chrome
I think Firefox stores the download history in the places.sqlite file in your Profile folder. You would need to open and read that file, but you probably can't while Firefox is open (it has the file open).
http://kb.mozillazine.org/Places.sqlite
From there, you can process the data in your Java app and then write an Excel file, perhaps using Apache POI (the Java API for Microsoft Documents)
https://poi.apache.org/
Where and how, download history is stored varies from browser to browser . In case of Chrome on Mac it is store in the path
~/Library/Application\ Support/Google/Chrome/Default/DownloadMetadata
as SQLite format.
You need to write an application to parse the data and create xls

How can i open a network stored file using JCIFS like ES File Explorer Does?

I'm working on an android app, and I can actually get a list of all my files, but can't use the URL to open a file from the list, I also tried to open from InputStream, but this does not work.
What I want to do is something like ES File Explorer does, I know they use JCIFS library, and that when you open a file (an MP3 for example), they make some kind of Tunnel with sockets, that reads the file and pass it to the propper app in an HTTP format.
Example:
If my nas file path is:
smb://My_IP_Address/SharedFolder/Media/MyMusic.mp3
ES File Explorer send an URL like this:
http:// 127.0.0.1:59777/smb%2FMy_IP_Address%2FSharedFolder%2FMedia%2FMyMusic.mp3
Sorry, I want to use comment instead of answer, but I don't have enough reputation...
What I found on ES Explore or other same app, they seemed not only use JCIFS , but also use nanoHTTPD...
They transfer the nas file to samba file, then use nanoHTTPD as a Streaming server to serve the multimedia files...
There got many sample on the web, here a discussion =>
How to serve a file on sdcard using NanoHTTPD (inside Android)
Hope this can help you...
It's off course doable but kind of tricky. Your app must act as a server, reading an input stream from the samba share, streaming it to a third party application like a music player if we are talking about a mp3 file.
You'll find details here : Android ServerSocket programming with jCIFS streaming files

hosting the database file on any cloud service

I have an android application, which wants the user to login each time he runs the app. So, the login procedure is simple, using the sqlite dabase file i'm using. I've copied the file in assets folder and doing the necessary modifications. But, the database file is of no use unless it is on the server. I don't have any server so i'm thinkin of keeping the database file on dropbox, google drive etc and then read or update that file as per user commands. The question is how to do that? I was searching the web for it, and found that the only way is downloading the db file modifying it and the uploading it back. Can anyone give me an example??
Doing that isn't possible unless you have a server.
Because, if you are using dropbox, first you'll have to make your file public in order to download it (Not recommended at all. Compromises security). Then you can use the url to download the file. But you won't be able to upload it back (Unless you are able to login to dropbox through your Android code).
Instead if you a web server with MySQL n PHP, you can easily send POST requests to your server.

Writing file from PHP page android

In my project a compressed file is displayed on a php in bytes.
I am trying to find a way to read the php page, decompress the file using GZIP, and write it out to the assets folder.
The file that I am reading in has to be placed in the data/data/package/database file.
I have a class that reads a file from the assets folder and places the file into data/data/package/database.
Is it possible to write to the assets folder during runtime? If not is there a better way to do this?
if the PHP script is running on a server, your Android app will need to make an HTTP request to retrieve the content. of course then it has to store it somewhere. the SQLite database is a good option, but you could also store content in files on the SD card.
there are a couple ways to do the HTTP connection part of it, and they're written up on the Android Dev Blog. Myself, I prefer the HttpURLConnection.

Android + SQL Server + jTDS

I'm trying to build an android app with connection to our SQL Server. I have downloaded the jTDS JDBC Driver. I have an jar file and have to copy it to my application's classpath. But where is that? I have copied to my workspace in the project directory where the file ".classpath" is. But it seems not to work.... everytime if I'm at the code where I load the class with
Class.forName("net.sourceforge.jtds.jdbc.Driver");
it says:
The source attachment does not contain the source for the file ClassLoader.class. You can change the source attachment by clicking Change Attachmend Source below"
Any ideas? I'm new to java AND android...
no need of that much of mess.
Simply for Mysql Server Data Access or any live server data access.
Make Use of Web Services
Its like prepare a dynamic page that have all the fetched data result from the server. Your android application need to hit that dyanamic page URL and then simply read the content from the streams and use them in your application.
Genrally large amount of data is expressed in xml format which is then parsed from the application See on google about SAXParser
In short its like a web page that will echo your server data after your app hit the url of that web page to read the data.

Categories