HTMLPanel commands - XPERIA X1 General

Hello,
lately I`ve been trying to make a nice html panel with all the stuff I want to. However I have not found any guide at all on what commands I could use.
The demo panel uses this code:
Code:
<img src="tasks.png" width="80" height="23"/>
<img src="home.png" width="80" height="23"/>
<img src="call_log.png" width="80" height="23"/>
<img src="close.png" width="80" height="23"/>
But I cannot find any other commands I could use. I would like to have a button that would start an empty text message. But I couldn`t find any documentation about it..

My Vodafone Panel has this (although it's an XML file)
Code:
<action x="0" y="0" width="0" height="0" type="launch" id="-1">tmail.exe:-service "SMS"</action>
Doesn't create a new SMS, but does open in the messaging app.

Related

Example of ADB pull command Question

Hi everyone,
I'm trying to pull the htcime fill from my nexus so as to do what is described on this website
http://ostebaronen.dk/changing-htc_ime-language-to-danish/comment-page-1/#comment-8407
I want to make it so I can change the input languages at will without having to go to settings and change the local.
My adb attempts have been successful, ie ./adb devices gives me the serial number so I know I'm connected, but when i try the following command:
./adb pull /data/data/com.htc.android.htcime/shared_prefs/com.htc.android.htcime_preferences.xml .
all i get is the menu that tells me what all the commands mean.
I'm on a mac, using terminal. I cd into the tools folder in the android sdk on my desktop and would like to pull the above file from my phone to my desktop.
Could you please tell me what it is that I'm doing wrong?
Thanks in advance...I've searched high and low, on this site and others, that's how I discovered to add the ./ on mac
Also, what is the correct adb push line as well....thanks again
Lou
For one, cause that file doesnt exist.
Nexus doesn't have HTCime installed
I know, but I added it.
I kept trying and managed to do it by putting a space before the last . so i was able to pull the file, change it, and push it back into the phone.
The only problem now is that it doesn't do exactly what I want it to do.
I want to have the option of changing back and forth between french and english dictionary, but the changes I made make it so that I can keep the system in English, but use a french dictionary. here is the xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<string name="keyboard_types">1</string>
<boolean name="predict_qwerty" value="true" />
<int name="MODIFIED" value="0" />
<boolean name="keyboard_ime_settings_pcqwerty_wc" value="true" />
<boolean name="keyboard_ime_settings_fqwerty_prediction" value="true" />
<boolean name="customized_kb_type" value="true" />
<string name="keyboard_language">0</string>
<boolean name="keyboard_ime_settings_others_vibration" value="false" />
<boolean name="predict_1220" value="true" />
<boolean name="keyboard_ime_settings_pcqwerty_sc" value="true" />
</map>
by changing the 0 to 1 here
<string name="keyboard_language">0</string>
I can have the french dictionary.
Is there a string I can add to give me the option between 0(english) and 1(french)
I tried copying the exact same string with the values changed under it, but it only takes the top one.
Lou

[Q] Reacting to a Mime-Type-Object

Hi,
i would like to know how i can get Android to react to a specific Mime-Type-Object that is embedded in a normal HTML Website. For example:
<body>
...
<object type="application/testApp" height=50 width=250>
<param name="param1" value="value1" />
<param name="param2" value="value2" />
...
</object>
</body>
I would like to start an application an initialize it with the given parameters. Thanks for your help. If you need further information please let me know.

AndroidManifest.xml Issue

I have decided to start learning the development side of Android, and have started on develepor.android.com. I've been following the tutorials to build the first app on there, using Android Studio. I got it to work fine, up until following the Starting Another Activity part. I guess I changed something in AndroidManifest.xml, and it absolutely will not compile now. I've ran the code validator numerous times, tried to compile it, googled for awhile, and it seems I have what it's asking for, but obviously not. the AndroidManifest.xml is:
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="schemas.android/apk/res-auto"
package="learning.application">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MyActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter> />
</activity>
<activity
android:name=".DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName=".MyActivity"
android:theme="@style/AppTheme.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="learning.application.com.MyActivity" />
</activity>
</application>
</manifest>
This produces an error:
Code:
Merging main manifest AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml
Merging result:ERROR
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml:12:9-23:20 Error:
Missing 'name' key attribute on element activity at AndroidManifest.xml:12:9-23:20
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml:16:13-22:29 Error:
Missing one of the key attributes 'action#name,category#name' on element intent-filter at AndroidManifest.xml:16:13-22:29
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml:17:17-18:65 Error:
Missing 'name' key attribute on element action at AndroidManifest.xml:17:17-18:65
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml:20:17-21:71 Error:
Missing 'name' key attribute on element category at AndroidManifest.xml:20:17-21:71
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml:26:9-34:20 Error:
Missing 'name' key attribute on element activity at AndroidManifest.xml:26:9-34:20
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml:31:13-33:71 Error:
Missing 'name' key attribute on element meta-data at AndroidManifest.xml:31:13-33:71
AndroidStudioProjects/learning.app/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
I've tried putting the package name in the android:name="foo" for the activity, and can't seem to figure out what I'm missing, I've googled around, and can't figure this thing out....apparently I'm that talented to screw up right off the bat, or not googling/understanding this? Can anyone show me what I'm missing?
**EDIT** Apparently it thinks that in the code is posting outside links, modified the top of AndroidManifest code so it'd let me post,
Figured it out, apparently, I changed the xmlns:android link to /apk/res-auto or something like that, when it should've been /apk/res/android...I removed the /res part for some reason...fixed that issue, now onto a java error.

App indexing: how to?

I'm implementing app indexing and I think I'm missing something, but I don't know what.
Following the guide I added my intent-filters to the app and implemented what's needed in my activity.
my application's package is com.towers.mypackage and the associated website (where I didn't put the link rel meta-tag yet, since I'm just testing) is www.mypackage.com
I saw the following intent-filter example in the guide
HTML:
<activity
android:name="com.example.android.PetstoreActivity"
android:label="@string/title_petstore">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.examplepetstore.com" />
</intent-filter>
</activity>
so I wrote mine in this way:
HTML:
<activity
android:name=".ActivityForAppIndexing"
android:label="@string/title_activity"
android:screenOrientation="portrait" >
<intent-filter android:label="@string/app_name">
<data android:scheme="android-app"
android:host="com.package.myappname" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="www.mywebsite.com" />
<data android:scheme="https"
android:host="www.mywebsite.com" />
</intent-filter>
</activity>
Also, I wrote a content provider in order to parse the URI
HTML:
<provider
android:name=".contentproviders.HotelDetailsContentProvider"
android:authorities="com.towers.mypackage" >
</provider>
which should map the URIs as follows:
Code:
private static final String BASE_PATH = "https";
private static final String AUTHORITY = "com.towers.mypackage";
public static final Uri CONTENT_URI = Uri.parse("android-app://" + AUTHORITY
+ "/" + BASE_PATH);
I'm testing the implementation via command line using the following adb command:
Code:
adb shell am start -a android.intent.action.VIEW -d "https://mypackage.com?hotel_id=135738" com.towers.mypackage
and IT WORKS. The app gets automatically opened with the right activity and the right parameters. When the app starts the onNewIntent method gets called:
Code:
protected void onNewIntent(Intent intent) {
String action = intent.getAction();
String data = intent.getDataString();
if (Intent.ACTION_VIEW.equals(action) && data != null) {
String recipeId = data.substring(data.lastIndexOf("/") + 1);
Uri contentUri = HotelDetailsContentProvider.CONTENT_URI.buildUpon()
.appendPath(recipeId).build();
bundle = new Bundle();
bundle.putString("pictureUrl", "");
//showRecipe(contentUri);
}
}
(I got it of course from the examples, that's why it talks about recipes)
But I wonder: what should I do? Get data from the intent with a
Code:
getIntent().getData().getQuery()
or use the ContentProvider and get them from the URI?
Also, I'd like to test with the Google Search Console and the "View as google" funcionality if everything is okay. I uploaded my APK and saw an URI is requested.
Now, in the "testing your app" section of the documentation I saw that the links like http://mypackage.com?hotel_id=135738 are referred as "deep links" while those like android-app://com.towers.mypackage/https/mypackage.com?hotel_id=135738 are referred as "URI". Am I right?
The "View as google" funcionality asks for a URI but I don't know how to create one. Also, I wonder how this URI is passed to the app and I'm pretty sure I'm getting very confused about this all URI/deepLink thing, and can't find relief in the documentation.
Where and when should I use the URI? Where and when should I use the deepLink? I guess that since I'm going to put the link rel=URI in my webpages then the app will be called in the app indexing with the URI and not with the URL of the page. But if it's so... why is the adb shell am start -a android.intent.action.VIEW -d command used for testing with the URL and not the URI? Should my app be able to get and handle URIs or URLs? And how?
I thought I had understood something about app indexing, but today I'm starting to think I got it all wrong since I started. That's why I ask you for help in answering the questions above, and possibly sheding a light on all this URL/URI/intent-filter/ContentProvider mess.
I already talked about this on Stackoverflow and got two answers, plus a lot of comments. But I wasn't able to get anything from that, App indexing remains a mysterious monster to me :-/
Did anyone of you manage to make this kind of things work? And how?
Thank you everybody, really.

[NST/G] Why doesn't the activity picker give this as an option?

I am trying to wrap my head around why some apps are given as options when trying to open a file from a file manager, and others are AWOL. My case in point is OverDrive 2.6.2 (yes I know, it can't fulfill books...that's another issue). The Android Manifest for the app contains all the sorts of intent filters as other readers, albeit with a smaller range of file types. Here's the intent filter section from the manifest:
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="epub"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/>
<data android:mimeType="application/epub+zip"/>
<data android:mimeType="application/vnd.adobe.adept"/>
<data android:mimeType="application/vnd.adobe.adept+xml"/>
<data android:mimeType="application/x-od-media"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="*" android:scheme="http"/>
<data android:mimeType="application/epub+zip"/>
<data android:mimeType="application/vnd.adobe.adept"/>
<data android:mimeType="application/vnd.adobe.adept+xml"/>
<data android:mimeType="application/x-od-media"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="file"/>
<data android:pathPattern=".*\\.acsm"/>
<data android:pathPattern=".*\\.epub"/>
<data android:pathPattern=".*\\.odm"/>
<data android:pathPattern=".*\\.ACSM"/>
<data android:pathPattern=".*\\.EPUB"/>
<data android:pathPattern=".*\\.ODM"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="*" android:scheme="http"/>
<data android:pathPattern=".*\\.acsm"/>
<data android:pathPattern=".*\\.epub"/>
<data android:pathPattern=".*\\.odm"/>
<data android:pathPattern=".*\\.ACSM"/>
<data android:pathPattern=".*\\.EPUB"/>
<data android:pathPattern=".*\\.ODM"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="file"/>
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="*" android:mimeType="application/*" android:pathPattern=".*\\.odm"/>
<data android:host="*" android:mimeType="application/*" android:pathPattern=".*\\.ODM"/>
</intent-filter>
As I read it, it should respond to ascm files and epub files when these are accessed in a file manager. And, in fact, newer versions of OverDrive do respond to epub files in this way (although, mysteriously, not to acsm files). This is on higher Android systems, of course.
Based on what I've been able to find written on the subject, this manifest would seem to have all the right stuff. Why doesn't the NST do what it should?
Well, check what the exact intent is with logcat.
Code:
# logcat *:s ActivityManager
This is also dependent on how your FIleManager likes to issue the intent.
It's probably a content: scheme, the newish way of doing things which has its own wrinkles.
Renate NST said:
Well, check what the exact intent is with logcat.
Code:
# logcat *:s ActivityManager
This is also dependent on how your FIleManager likes to issue the intent.
It's probably a content: scheme, the newish way of doing things which has its own wrinkles.
Click to expand...
Click to collapse
Since I'm using a very old version of ES File Explorer on the NST, it's unlikely a newish way. I'm not sure exactly what I should be checking since I can't get OverDrive to appear in the picker, but I did follow your idea for a reader option that does appear in the picker, AlReader. I've attached an image of the results below when accessing an epub file from the File Explorer.
It looks like it's using the VIEW--DEFAULT--application/epub+zip intent which is in the manifest for OverDrive, so I'm still not sure where the issue is. I went back to check on the manifest for AlReader (I had been looking at the manifest for CoolReader which is very similar to OverDrive in structure, but lacks the BROWSABLE). I found this in each intent filter for AlReader:
Code:
<action android:name="android.intent.action.PICK"/>
I wonder...
I still don't know specifically what you are talking about.
Your log shows an intent working correctly.
(Also, screenshots with wraparound are hard to read.)
You're going to have to tell me:
What is issuing the intent.
What the intent is.
Show that the intent is not matching anything.
Or show that the intent is matching what you don't want it to match.
Renate NST said:
I still don't know specifically what you are talking about.
Your log shows an intent working correctly.
(Also, screenshots with wraparound are hard to read.)
You're going to have to tell me:
What is issuing the intent.
What the intent is.
Show that the intent is not matching anything.
Or show that the intent is matching what you don't want it to match.
Click to expand...
Click to collapse
My response deserved yours. My former students would be delighted
So...I took at look at the intent which opens the epub in AlReader, just to use it as an example, and tried to feed it back to the NST via ADB to see what would happen. This is what I tried:
Code:
# am start -a android.intent.action.VIEW -c android.intent.category.DEFAULT file:///sdcard/Books/Wright%2C%20Lawrence%20-%20The%20End%20of%20October.epub typ=application/epub+zip flg=0x10000000 com.neverland.alreader/com.neverland.alr.AlReader3Activity
To my surprise, the device ignored all the stuff about AlReader (probably not formatted right) and instead popped up the system activity picker (as opposed to the activity picker in ES File Explorer) and there, lo and behold, is OverDrive as one option. Selecting that, OverDrive opens and places the book on its bookshelf, just as I had hoped it would (step one).
If I shorten my ADB command to:
Code:
# am start -a android.intent.action.VIEW -c android.intent.category.DEFAULT file:///sdcard/Books/Wright%2C%20Lawrence%20-%20The%20End%20of%20October.epub
I get a "Warning: Activity not started, its current task has been brought to the front" but the picker still pops up and selecting OverDrive opens to the bookshelf where the book, happily, does not duplicate itself.
There is a little formatting weirdness, but it could just be this particular book and I have not played around with the Settings yet.
This is also not very practical, although I could probably work around it in some really clumsy way. So, you were right, it is the file manager which is not showing OverDrive as an option for some reason. The Android system is well aware that OverDrive can be used to open epub files (probably acsm, too, although it would not be able to fulfill them, so that's moot).
So, to summarize your complaint: "a very old version of ES File Explorer does not activate OverDrive 2.6.2 when selecting a [epub?? acsm??] type of file.
Renate NST said:
So, to summarize your complaint: "a very old version of ES File Explorer does not activate OverDrive 2.6.2 when selecting a [epub?? acsm??] type of file.
Click to expand...
Click to collapse
Correct. When you put it that way, it's pretty funny, but in my defense I did specify NST in the OP, so it's all old.
nmyshkin said:
Correct.
Click to expand...
Click to collapse
Ok, but you still have not shown a log of a file manager attempt failing.
It's still ambiguous whether you want/need epub or acsm.
I still have no idea what you want to actually do.
Renate NST said:
Ok, but you still have not shown a log of a file manager attempt failing.
Click to expand...
Click to collapse
I don't think I can. The ES File Explorer picker does not offer the option of opening with OverDrive. The Android system picker does (and succeeds). So there's no error to report since there is no action possible via the file manager.
It's still ambiguous whether you want/need epub or acsm.
Click to expand...
Click to collapse
epub
I still have no idea what you want to actually do.
Click to expand...
Click to collapse
The ultimate goal is to open an epub downloaded/authorized by OverDrive on the sdcard-CM 11 ROM, with OverDrive on the stock Android 2.1 ROM (authorized with the same Adobe ID). The two ROMs each have access to the /media partition and this is where I've had the downloaded epubs saved.
I'm just experimenting, to see if it can be done. Meanwhile there are "baby-step" hurdles, like this one. Or the fact that I've used up my Adobe activation count and need to have it reset. Careless of me.
As I've said, put your finger on the file in your file manager.
If something starts that isn't what you intended, disable it in PM and try again.
Copy the significant portion from the logcat.
Renate NST said:
As I've said, put your finger on the file in your file manager.
If something starts that isn't what you intended, disable it in PM and try again.
Copy the significant portion from the logcat.
Click to expand...
Click to collapse
Thanks. I will do that to see what I can learn. However, the point appears moot now. I created a new Adobe account since I could not get any action from them for a count reset. With the OverDrive app on the stock ROM and the OverDrive app on the CM 11 ROM signed in to the same account, I was not able to open a book downloaded by the CM 11 ROM app with the stock ROM app. It sees the book and puts in on the bookshelf, but gives a variety of error messages when I try to open the book. I'm guessing that it needs to refer to information stored in database files when the epub is downloaded, and when you just try to open the file as if it were any old epub, it can't read it properly. Still, I am curious as to why the ES File Explorer activity picker responds with options different from those of the system app picker, so I will try what you suggest.

Categories

Resources