Move to SD Card? - android

I have an app "Gurbani Ujagar" which views about 3000 HTMl pages using WebView. I have received many emails about adding an move to SD Card option. I have no idea what that means, how that makes a difference, and how I can add this option?

This is actually incredibly easy to do! First, make sure your target API level is 8 or higher. If it is, you can simply include this code in your manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal"
... >
For more information, check out this android developer page.

Related

AndroidManifest.xml xmlns isn't working in Android Studio

My manifest is interpreting my xmlns:android as an error, saying that I should "add Xsi schema location for external resource":
Could someone please tell me what's going on with my projects' manifests, it's really confusing since I don't know when this even started happening.
Thanks in advance!
You need not worry about this file. On the top of the file, you see that is an auto-generated file. You need not modify it. If you modify it, then run your app, again it will be changed to what it was before. So you need not modify it.If you want the original manifest, below the code in the manifest, you will see two tabs named Merged Manifest and Text. The Text is the one you need to modify. See the image below
See the bottom of the image. Never ever bother about the Merged Manifest. If you do, you will waste your time

Convert web based database management application into mobile app to make it work offline

We have no knowledge of mobile applications. We need to convert a basic web-based database management application in Laravel into a mobile application. Is there a way to do it without having mobile application developers. The application has the following views
1. Form
2. Edit form
2. All forms
3. Users
4. Edit Users
There are two user type - Admin and data entry operator
Yes, you can do it using webview. Start a project in android studio, create a class extending from Activity, a xml layout file in res/layout, and take a look on your AndroidManifest file in the manifests folder.
It will look more or less like this:
The image also shows you the basic structure of the activity, though you don't really need the onCreateOptionsMenu part. Now to make the webview put this in the xml:
<WebView
android:id="#+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
And call it on your onCreate method like the one shown in the image:
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://www.example.com"); //change the link to your
In your manifest add permission for the application to use internet:
<manifest ... >
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
If you want to make your webview work offline you could use webview cache.
But since it is a database managing application, you probably will need to make a full app, and for that you will need an mobile developer. But you could use other approaches, like using xamarin, ionic or other transpilers, though that will still require learning, it is easier for programmers of other areas to adapt, then maybe you could avoid hiring a mobile programmer.

Android API guides (with figures) for offline use

I'm looking for a possibility to browse the android API guides offline (with figures). I read several questions about this here (ex. 1, 2, 3...) and tried to get offline docs from the sdk folder or using a direct link. The problem with the actual version (23_r01) is that the images are often not displayed. For example in the page sdk/docs/design/index.html the image hero-material-design.png could not be displayed because of a bad src tag.
What I've tried:
Using the docs from the SDK folder
Direct download from https://dl-ssl.google.com/android/repository/docs-23_r01.zip
Saving the files using HTTrack (I'm getting errors here..)
What I would like to achive:
Download a correct version of the docs
OR "Repair" all the broken image paths in the html files
I would appreciate any help.
If thats still interested to you, just edit \docs\design\index.html, add .. before /design (it means the parent folder, one dot means the current), like that:
<img class="dac-hero-image" src="../design/media/hero-material-design.png">

Can't Delete Contacts from Read-Only Accounts - Sync Adapter

I've created a custom SyncAdapter and given it the following XML:
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.android.contacts"
android:supportsUploading="true"
android:userVisible="true"
android:accountType="#string/authenticator_account_type"/>
Thousands of searches has led me to 'supportsUploading="true"' but this is definitely not the case - contacts are still being marked as read-only.
Since most of the documentation has a very "self-explanatory" vibe to it (Which is definitely not the case), I have no idea where to begin. Could someone please give me direction on this?
Edit: I even verified that the Account was in line with what Google has set for their accounts:
The problem turned out to be that the contacts information has to be set up in a very particular way. It includes having an XML file with a ContactsAccountType definition, a sync adapter XML file (sync-adapter) with android:supportsUploading="true" set... And there appears to be no one particular solution to this - if anything is not set up fully, the OS will treat ALL contacts as read-only.
I was able to copy the default contact from AOSP and modify it, removing things very slowly, one at a time (As like I mentioned, one wrong removal means read only) until I got it down to what was necessary.
The downside is, because both the OS as well as any function related will return that the contact is editable, it does not mean that the OS will allow it.

Why does accessing Android MediaStore, using MonoDroid, generate UnauthorizedAccessException?

When I attempt to use the solution presented on SO here for dealing with large bitmaps in Android, I get an UnauthorizedAccessException at the point I'm trying to read from the file system from a location such as:
/mnt/sdcard/DCIM/Camera/IMG_20111223_122513.jpg
Is there a particular permission in my manifest I was supposed to select, or something else going on?
Well, there is always this one:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
If you're looking to display a screen-sized version of a full-resolution photograph, may I please refer you to the Android Training article on this subject.

Categories

Resources