Json and SQLite - Android Developer Previews

is it possible to take a json file and put it on a db like sqllite

smaug117 said:
is it possible to take a json file and put it on a db like sqllite
Click to expand...
Click to collapse
More details please on what you want to accomplish

it is possible.. but
It is possible, but it is not recommended.
If you want to store json objects, just use a Json databses like MongoDB, Cassandra, Redis, CouchDB etc..

smaug117 said:
is it possible to take a json file and put it on a db like sqllite
Click to expand...
Click to collapse
Of course it is possible. Json it is string it is not problem store string in any Database.

Thank you

Hayzohar said:
It is possible, but it is not recommended.
If you want to store json objects, just use a Json databses like MongoDB, Cassandra, Redis, CouchDB etc..
Click to expand...
Click to collapse
Yes, u r right!

yes, it's possible
json -> to Gson -> class Models -> Save to Sqlite using Realm or Room

Hayzohar said:
It is possible, but it is not recommended.
If you want to store json objects, just use a Json databses like MongoDB, Cassandra, Redis, CouchDB etc..
Click to expand...
Click to collapse
i wanna do that too , i have a json database and i wanna store it in sqlite cause i have alot of sorting operations to do i need stuff like select * from table where condition having ,,order by mostly order by so ? what advice u can give me please ?

Related

[APPS][GAMES] Best Apps & Games for Galaxy 3 - PLEASE POST GUYS :)

Hey Guys,
Here is a list of all the Best Applications and Games for Galaxy 3.
I'll keep on updating the list as and when new apps and games release.
Also suggest me what apps you feel should make it to the list
All files will have a link to the market/appbrain.
@Moderator: Please don't delete any post from the thread, as it will change the post numbers. And all Links will change.Thanks
Disk & File Tools
File Manager
File Expert
ES File Explorer
Root Explorer
ASTRO File Manager
Dual File Manager
File Manager
AndroZip File Manager
Open Manager
File Manager
Click to expand...
Click to collapse
Storage Manager
App 2 SD Free (move app to SD)
1Tap Cleaner Free (Cache/His.)
a2sd Froyo Root
Partitions Info Lite
FreeSpace
AppAdmin
Click to expand...
Click to collapse
Online Backup
Dropbox
Photobucket Mobile
IDrive (Online Backup)
Memopal Online Storage
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Desktop & System
Launchers
LauncherPro
GO Launcher EX
ADW.Launcher
Launcher 7
Zeam Launcher
Click to expand...
Click to collapse
Desktop Search
Click to expand...
Click to collapse
Wallpaper Changer
Click to expand...
Click to collapse
Task Manager
Click to expand...
Click to collapse
Installer
Click to expand...
Click to collapse
Uninstaller
Click to expand...
Click to collapse
Battery Manager
Click to expand...
Click to collapse
System Monitor
Click to expand...
Click to collapse
System Information
Click to expand...
Click to collapse
Clipboard Manager
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Multimedia
Media Player
Click to expand...
Click to collapse
Music Player
Click to expand...
Click to collapse
Video Sharing
Click to expand...
Click to collapse
Radio Broadcasting
Click to expand...
Click to collapse
Ringtone Changer
Click to expand...
Click to collapse
Ringtone Maker
Click to expand...
Click to collapse
MP3 Tag Editor
Click to expand...
Click to collapse
Remote Control
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Image Tools
Image Viewer
Click to expand...
Click to collapse
Image Editor
Click to expand...
Click to collapse
Business Card Reader
Click to expand...
Click to collapse
Barcode Scanner
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Home & Office
Office Suite
Click to expand...
Click to collapse
PDF Reader
Click to expand...
Click to collapse
E-Book Reader
Click to expand...
Click to collapse
Calendar
Click to expand...
Click to collapse
Timer and Alarm
Click to expand...
Click to collapse
Notepad
Click to expand...
Click to collapse
Reminder/To-do List
Click to expand...
Click to collapse
Personal Finance
Click to expand...
Click to collapse
Dictionary, Encyclopedia and Translator
Click to expand...
Click to collapse
Calculator
Click to expand...
Click to collapse
Unit Converter
Click to expand...
Click to collapse
Compass
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Internet & eMail
Web Browser
Click to expand...
Click to collapse
Webmail
Click to expand...
Click to collapse
Email Client
Click to expand...
Click to collapse
Download Helper
Click to expand...
Click to collapse
RSS Reader
Click to expand...
Click to collapse
Web Search
Click to expand...
Click to collapse
Navigation
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Phone & Messaging
Dialer
Click to expand...
Click to collapse
Contact Manager
Click to expand...
Click to collapse
Messaging
Click to expand...
Click to collapse
Instant Messaging
Click to expand...
Click to collapse
Voice over Internet Protocol
Click to expand...
Click to collapse
Phone Browser
Click to expand...
Click to collapse
Voice Activation
Click to expand...
Click to collapse
Call & Message Filter
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Website, Server & Network
Social Networking
Click to expand...
Click to collapse
Blog Publishing
Click to expand...
Click to collapse
Remote Access
Click to expand...
Click to collapse
Network Traffic Counter
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Security & Privacy
Anti-malware
Click to expand...
Click to collapse
Apps Protection
Click to expand...
Click to collapse
Password Manager
Click to expand...
Click to collapse
Device Tracker
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Education
Language Learning
Click to expand...
Click to collapse
Articles and Answers
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Sports & Games
Sports
Click to expand...
Click to collapse
Arcade & Action
Click to expand...
Click to collapse
Brain & Puzzle
Click to expand...
Click to collapse
Cards & Puzzle
Click to expand...
Click to collapse
Casual
Click to expand...
Click to collapse
Sports Games
Click to expand...
Click to collapse
Racing
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Note:
1) All the above apps and games are works of their respective developers.
2) Any problem with the apps should be notified to the developer and not on this thread.
3) Please do not upload apk files in the thread.
4) No posting of warez allowed in the thread.Anyone found uploading will be reported to the moderator.
well this is something worthed!
Subbed!
File Expert
File Expert
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
* All basic file operations - Copy, Paste, Move, Create and Rename your files and folders
* FTP/HTTP Server - Share & Manage your files without a USB cable, just like with Web Sharing or WIFI File Explorer, but we do even more because we can provide both Web & FTP transferring support. We support HTTP authentication and FTP account login.
* Root access to system folders and files like Root Explorer. Remount those locations to read write. Requires rooted phone to function. This feature is in BETA testing. Use it on your own risk.
* SMB Client - Access your host computer from your phone, using your phone to manage your PC via WIFI with SMB
* App Manager - Uninstall/Backup apps. We know that many apps on the market can do this, but none can do this work silently. We're the ONLY app that can install and uninstall apps silently, which makes your batch process faster and cooler. Silent capabilities require a rooted phone to function.
* Archive manager - Create and decompress ZIP archive, Decompress RAR archive. You can view your ZIP/RAR file just like accessing a folder and directly decompress unique files and folders from those archive
* Thumbnails - supports jpg/png/mp3/mp4/3gp thumbnails
* Text Viewer - supports very large TXT files. This feature is still under development, we will continue to improve its functions
* Image Viewer - supports both local and remote folder, we will support gesture detection and multi-touch zooming in the future release
* Search SD card
* Help your player to play media that stores on SMB share (your player needs to support HTTP streaming). Just like some users on the app comments said, WE are the ONLY file manager that can directly open some types of videos over SMB network
* File Picker - Let FE to help you anywhere you want
MARKET
Well,this is one useful thread.
I would like to see WidgetLocker to be added to the category hmmm..... maybe LockScreen (It's so difficult to find a place for it the above categories )
And pls dont forget Titanum Backup
akash.gpta said:
Well,this is one useful thread.
I would like to see WidgetLocker to be added to the category hmmm..... maybe LockScreen (It's so difficult to find a place for it the above categories )
And pls dont forget Titanum Backup
Click to expand...
Click to collapse
The sub categories still have to be added...
I am sure widgetlocker will make up in some category
All the categories are updated...Will start Posting apps now
ES File Explorer​
Free,Featured File manager & Appmanager & taskkiller which explores PHONE & PC
*copy/cut move
*thumbnails
*multiselect
*edit text
*manage apps
*multiple send
*search
*(de)compress
*media on ftp
*access home PC
*bluetooth
MARKET​
ASTRO File Manager​
Features: File Manager, Backup, Image and text viewers, Networking, SMB, Bluetooth, SFTP, Zip Tar, downloader, thumbnails, search files, application manager, task manager, attachments
MARKET​
ROOT EXPLORER​
Root Explorer is the ultimate file manager for root users. Access the whole of android's file system (including the elusive data folder!).
Features include SQLite database viewer, Text Editor, create and extract zip or tar/gzip files, extract rar archives, multi-select, execute scripts, search, remount, permissions, bookmarks, send files (via email, bluetooth etc), image thumbnails, APK binary XML viewer, change file owner and group.
Market
​
For reference
NAME​
Desciption
Market​
Dual File Manager​
A total commander like sw with the most powerful file & search engine ever seen!
* Double page explorer browser
* Thumbnails for APK, audio, video, image (also inside ZIP)
* Compress Zip (encrypt w/ password), GZip, Tar
* Search files also inside Zip, GZ, Tar
* Extract Zip (legacy 2.0), GZ, Tar
* Test check archive integrity
* Calculate MD5 & CRC32
* Desktop folders
* Multi language
* Multiselect
* Home folder
* Streaming
* File sort
* Bookmarks
* Open as
Market​
File Manager​
Full featured file manager on Android, fresh UI design and user friendly functions!
Includes:
* 3 sets of commercial icons for 60+ different file types, toolbar and menu items
* Multiple resolution support
* Cut, copy, paste and cancellable progress dialog
* List and grid view for file browsing
* Compress and decompress support
* Search and share files
* Multiple selection and sorting support
* Support both local and remote(LAN/SMB) file system
* Thumbnail for photo, pictures and apk files
* Built-in text editor and swf player
Market​
AndroZip File Manager​
Works as file manager, archive manager (ZIP, encrypted ZIP, RAR, TAR, GZIP, BZIP2, 7ZIP - BETA - under development), app backup, Task manager, search files, app installer, send files, app installer.
Has multiple/batch move, copy, delete, create ZIP
Installs to SD card (app 2 SD)
AndroZip can create encrypted (AES 256 bit) ZIP files compatible with WinZip.
If you like AndroZip please buy AndroZip Pro to support development.
Market​
File Manager​
This is a file manager based android.
main functions:
1.LAN file sharing;
2.Search file;
3.Open file;
4.Rename file;
5.Delete file;
6.Copy,paste and cut;
7.Set wallpaper;
8.View folder;
9.Sort by name,type,size and time;
10.View by thumbnail and tile;
11.Direct install apk;
12.Share file;
13.Displayed directly APK file icon;
14.Support multi-file operations;
15.Support multi-keyword file search;
16.Shows the progress of copying files;
Market​
Open Manager​
This is a free and open source file manager for Android supporting Android version 1.6 and above.
Open Manager:
* copy/paste
* cut/paste
* delete/rename
* multi-select
* search
* (un)zip files
* attach files to email
* install applications
* backup your applications
* view running processes
* Ads free
(more)
Market​
Ok Guys I have added the File Managers in the list
Now please start voting on which file manager do you recommend
For voting copy the list from below and Increment the number besides the app you recommend:
File Expert - 0
ES File Explorer - 0
Root Explorer - 1
ASTRO File Manager - 0
Dual File Manager - 0
File Manager - 0
AndroZip File Manager - 0
Open Manager - 0
File Manager - 0
So now the list is
File Expert - 0
ES File Explorer - 0
Root Explorer - 2
ASTRO File Manager - 1
Dual File Manager - 0
File Manager - 0
AndroZip File Manager - 0
Open Manager - 0
File Manager - 0
guys, please increment the no. by one and copy the complete list..
please dont give a +1...its difficult to keep a count...and this way it is gonna benefit everyone as more and more apps come to the list...
File Expert - 0
ES File Explorer - 1 <=====
Root Explorer - 2
ASTRO File Manager - 1
Dual File Manager - 0
File Manager - 0
AndroZip File Manager - 0
Open Manager - 0
File Manager - 0
App 2 SD Free (move app to SD)​
Are you running out of application storage?
Do you hate having to check each and every app if it supports moving to the SD card?
Do you want an app that automatically does this for you and can notify you when an app can be moved?
"App 2 SD" helps you to move apps to either external or internal storage thru' the system Settings. This app is crucial to anyone who has memory management issues.
★ list movable apps
★ move one or all apps to SD card
★ notify if movable app installed
★ 1-tap to clear all app cache
★ add movable apps to the ignore list
★ show app cache/data/code/total size
★ show storage total/available size
★ list non-movable apps
★ move app back to the internal storage
★ view app on Market
★ uninstall app
★ open app
★ show app details page
★ support "Move2SD Enabler"
★ customizable notification sound, vibrate and light
This app is not used to backup apps to SD card. It only helps you to move a portion of apps used space to SD card. You have to manually install the apps after switching to a new phone or hard reset.
If app uses any of the following features, it cannot be installed on the external storage. It's required by Android system.
App Widgets,
Services,
Input Method Engines,
Live Wallpapers,
Live Folders,
Alarm Services,
Account Managers,
Sync Adapters,
Device Administrators
App shortcuts will disappear from the home screen after you move apps to the SD card. It's the limitation of Android system.
Market​
1Tap Cleaner Free (Cache/His.)​
1-Tap to clean all cache and search histories. Are you running out of application storage?
You now can get more available storage space by clearing apps created cache/data files, search history records and Browser navigation histories.
Auto or 1-tap to clear all cache, search history, and the best is you don't have to ROOT the phone anymore! This app is crucial to anyone who has memory management issues.
★ 1-tap to clear all cached files
★ 1-tap to clear all search and browser navigation history records
★ auto clear all cache and history at a specified interval
★ auto clear cache when the device is low on internal storage space
★ clear cache or history for a specified application
★ notify you on startup if apps used cache size large than 500K bytes
★ list applications by either cache, data, code, total size or app name
★ view application on Market
★ uninstall application
★ open application
★ show application details page
For user's manual, FAQ, please tap MENU > Settings > About for details.
Market​

Problem writing data to a file

Hi everyone, i'm new to Android development and i have a incovenient bug. Well, i used the 'Top-Down- method to fix all my requirements, but it misses this one. I'm trying to write data to a file, and to be able to access this data in a remote html in a webview. Although i managed to create the file, here's the code
Code:
File file = new File("data/data/com.template.WebViewTemplate/test.txt");
if (!file.exists()) {
try {
file.createNewFile();
WriteSettings(this,"setting0, setting1, setting2");
} catch (IOException e) {
e.printStackTrace();
}
}
and the test.txt file is empty.
I'd love to fix that issue that really bothers me, though i have to have done it by thursday evening ( here in France ), thanks a million ( please excuse my english i'm french )
First of all, path must start with /. And I'm not sure u can write here. Try /sdcard/text.txt location.
Also, try using FileWriter class. I think it'll be better.
Sent from my HTC Sensation using xda premium
Why not use shared preferences?
It looks like you are setting preferences guessing that's what you are doing but could be very wrong lol.
Pvy
Sent from my Galaxy Nexus using Tapatalk 2
jarj28 said:
Hi everyone, i'm new to Android development and i have a incovenient bug. Well, i used the 'Top-Down- method to fix all my requirements, but it misses this one. I'm trying to write data to a file, and to be able to access this data in a remote html in a webview. Although i managed to create the file, here's the code
Code:
File file = new File("data/data/com.template.WebViewTemplate/test.txt");
if (!file.exists()) {
try {
file.createNewFile();
WriteSettings(this,"setting0, setting1, setting2");
} catch (IOException e) {
e.printStackTrace();
}
}
and the test.txt file is empty.
I'd love to fix that issue that really bothers me, though i have to have done it by thursday evening ( here in France ), thanks a million ( please excuse my english i'm french )
Click to expand...
Click to collapse
Take a look at developer.android.com/guide/topics/data/data-storage.html, this contains some good documentation on how to use the various storage options. I sounds like you want either private internal or public storage.
Thanks to everyone for your replies !
As far i know, the file is created, i can look for it in /data/data/com.packagename/filename.txt. But it is empty :/
How can i use sharedprefs? Thanks a lot !
EDIT : I looked at the docs, but still can't get where to save the preferences
EDIT 2 : YEEEAAHHHH THANKS !!! I used
Code:
String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
Great !!! Now i face another problem, but maybe i'll do another thread. I need to access the file through my WebView, and i need to figure out how to save the data from a list of countries
jarj28 said:
Thanks to everyone for your replies !
As far i know, the file is created, i can look for it in /data/data/com.packagename/filename.txt. But it is empty :/
How can i use sharedprefs? Thanks a lot !
EDIT : I looked at the docs, but still can't get where to save the preferences
EDIT 2 : YEEEAAHHHH THANKS !!! I used
Code:
String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
Great !!! Now i face another problem, but maybe i'll do another thread. I need to access the file through my WebView, and i need to figure out how to save the data from a list of countries
Click to expand...
Click to collapse
EDIT 3 : Is there someone i can PM ?

[GUIDE] How To Make An Android App

Introduction
Hello and Welcome to android app development guide. In this [guide] i will teachyou how to develop applications for the android platform using java and some simple tools. I will also teach you to add audio/video to your apps and also teach how to make them location aware by adding gps function to it
Click to expand...
Click to collapse
What You Should Know
Here I am just letting you all Know the pre-requisites of making an app. But then if you dont match the pre-requisites..... its OKAY !! I started it without this xD
Some Experience Of Object Oriented Programming
Some Experience of JAVA
Experience of Using ECLIPSE
Have An ANDROID phone so that you know the capabilities of Android
Click to expand...
Click to collapse
Preface:Guide to make an android app
Click to expand...
Click to collapse
Setting Up the System
Setting Up the System
Downloading The Basic Equipment For Android App Development
Click to expand...
Click to collapse
Overview
Android Architecture
Runs on Linux 2.6
Dalvik Virtual Machine, Which Is optimised for mobiles
Integrated Browser, based On Webkit Engine
Optimized Graphics with Open GL ES
SQLite Database for Data storage
Click to expand...
Click to collapse
Android Application Fundamentals
Applications are written in JAVA programming Language
Compiled Into Android Package file (.apk)
Each Application runs in its own sandbox and linux processes
Applications consists of Components, Resources and a Manifest file
Click to expand...
Click to collapse
Components:
Activities
Single Screen with a UI [a screen seen by a user, it is an activity. basically a single screen, seen by the user IS an ACTIVITY ]
Multiple Activities are required to make a user friendly application
When a new activity starts, old activity is pushed on to the Back Stack [ it becomes handy and fast if you press the back button on the phone. the activity on the back stack is not needed to be loaded again ! ]
UI can be built with either by XML ( recommended) or in Java ( I hate doing that )
You can manipulate the lifetime of the activities by certain call back methods. such as onStart[], onPause[], etc.
Click to expand...
Click to collapse
Services
They perform long-running operations in the background.
Doesn't contain ANY user interface
Useful for network operations, playing music, etc.
Runs independently of the component that created it ! --> [ say a service that launches a Service is closed. the service is still running ]
They can be bound to other application components. [ IF allowed ]
Click to expand...
Click to collapse
Content Providers
Used to store and retrieve data and make it accessible to any application.
Since, there is no way to share data across the applications, it is the only way !
Exposes a public URI that identifies the data set with some unique method or codes.
The data is exposed by a simple table on a database model concept.
Android contains many providers for things like contacts, media, etc.
Click to expand...
Click to collapse
Broadcast Recievers
A component that responds to system-wide broadcast announcement.
For Example, if the battery is low, Android Sends a system-wide broadcast, and the application that is listening to it, is responded by a Broadcast Reciever.
Applications can also initiate a broadcast that different applications can respond to ! example --> if an application, app1, is dependent on another application, app2, it can start a broadcast for app2. if the app2 exists, it can proceed else it will pop up a message like --- "app2 doesn't exist. plz download it from the market"
They, like services, contain no UI
Can be used to create Status Bar Notifications
Click to expand...
Click to collapse
Android Manifest File
All applications MUST have an AndroidManifest.xml in its root directory.
Presents the information about the application to the Android System.
Declares the Components used in the application
Also Declares the permissions required from the user to run the application.
Declares the Minimum Android API level to run that application. [ eg: GingerBread, HoneyComb, IceCreamSandwich, etc. ]
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Details About Some Folders
Have You ever Decompiled any apk file ?? If not, do it, cuz it is really important part of app making. since there are many relative things to this.
In here I will Explain about some folders you get to see in a folder named "res" when you decompile.
layout
In This Folder, You will find some xmls, which looks more like a web page source
And Gibberish until you take a CLOSE LOOK !
It actually stores in the Layout of your activity. You will get to be familiar with this as we are going to use this
Click to expand...
Click to collapse
drawable
In this folder, You will get the things that makes the app look beautiful !
Ha! This contains "pngs" that are used in themes. We Will come to this as time passes
Click to expand...
Click to collapse
xml
In here, Again, XMLs with someting Gibberish till you get a closer Look ! These xmls store your preference activities.
Click to expand...
Click to collapse
anim
This folder, again xmls, which seem more unreadable. This folder, as the name says, it stores the anim files that has instructions for your animations that you (will) use in the app.
Click to expand...
Click to collapse
values
This folder, again xmls, which seem even more unreadable. This folder, stores the values for different stuff, like ids, integers color hex's, etc (we will get to this later) .
Click to expand...
Click to collapse
colors
This folder, again xmls, as the name says, stores the colors that you (will be) using in the app (we will get to this later) .
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Activities And Explicit Intents
Activities & Explicit Intents
As I've already told you that Activities are one of the primary building blocks of your app. here, we will learn how to create actiities, declare them in AndroidManifest.xml and We will also learn How to go to another activity from one activity. Okay. So now open up Eclipse. and sart a new Android Project.
Click on File >> New >> Android Project
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Fill in the details as you wish.... and click finish.
After you make a Project. You will get A full working Hello world Application. now, modify the MainActivity.xml in the graphical part like this
make a new xml file by clicking
. Give a file name like... SecondActivity.xml or something you like Note: This Will be your Second Activity. and now click Finish
Now drag the " TextView " from the " form widgets" tab from the left side panel to the graphical editor of your second activity.
Now, Basically what i want to teach is Explicit Intents. Now what we want our app to do is the text written in the MainActivity should be shown to the user when he clicks the "go to second activity" button. So to do this, we need to declare and do something with JAVA !
navigate to the .java files -->
Double click the java file and you will et something like this ( gibberish... if you dont like java like me )
since we need to define the "EditText" field and the "Button" from the first activity !
Now, find this
Code:
setContentView(R.layout.main);
after that start typing
final EditText et = findView
now press ctrl+space (windows)
it will show you a list of commands. choose findViewById(id)
now it will automatically place you along the (id). now start typing ---> R.id.
and press ctrl+space (windows).
chose the EditText Value..... Now as you see, it will show an error there. press ctrl+1 to show quick fixes. Add a cast to EditText. Final text will be Like this
Code:
final EditText et = (EditText) findViewById(R.id.editText1);
Now do the same with the "Button"
Code:
Button b = (Button) findViewById(R.id.button1);
Now that you have defined the button. Now you will have to set an OnClickListener for that button. so the it allows User to go to the second activity.
now start typing
b.setOnclick... press ctrl+space and choose onClickListener. It will automatically place you in the "()" type there --> new OnClickListener press ctrl+space. you will get something like this
you will get an error. so go to the place ( marked red in the pic and put a semi-colon )
now, in the following method,
Code:
public void onClick(View arg0) {
// TODO Auto-generated method stub
}
start typing the following
Code:
Intent intent = newInt
press ctrl+space and choose this
It will automatically place you in packageContext.
NOTE:
packageContext == "The java file that is creating the Intent";
cls == " The java file to whom the Intent Should be passed";
so, edit it this way
Code:
Intent intent = new Intent(MainActivity.this, SecondActivity.class);
NOTE:
MainActivity == "The java file that you are editing";
SecondActivity == " The java file That WILL represent the the SecondActivity.xml";
It will give you an error. press ctrl+1 and select--> create class "SecondActivity"
Fill in the details of the new java file and click finish. Now go back to previous java file.
Now, you have created an intent. But its not defined that what will that intent do !
So, now, Lets define that
start typing--> intent.putExtra and press ctrl+space. choose this.
now, you will be automatically placed in the "key". now for the key, you will have to type a string. i would like to call it "thetext". Now, Make sure you type the string WITHIN THE DOUBLE QUOTES..
For the value, you will have to give the reference of the "EditText" Field. here, i have given it as "et", i will type it this way.
intent.putExtra("thetext", et.getText().toString());
Click to expand...
Click to collapse
Now, you have successfully DEFINED what the intent does. but if you check the coding..... you will notice that the intent is never initialised ! now, to initialise it, type in this -->
startActivity(intent);
Click to expand...
Click to collapse
the final MainActivity.java should look like this.
Click to expand...
Click to collapse
Now, its almost done..... BUT.... ! what the hell is the use of the secondActivity.java ! ?
It is to be edited. only then the text written in the first activity by the user will be shown in the second activity. to do that, go to second activity. Now,
EASY PART
Find this in the first java file:
Copy all that stuff to the SecondActivity.java
Change the blue highlited text ( in eclipse ) to the name of the second xml file. (just dont add the extension)
Hard PART
Now, you gotta define the "TextView" on the SecondActivity.xml Since you have given the reference to the SecondActivity.xml by copying all that stuff.
so, start typing,
Code:
TextView tv = findView
NOTE: Here "tv" is the name you have assigned to the "TextView". You can change it if you want. BUT makesure you do the cahnges accordingly in the next steps.
hit ctrl + space. choose >> findViewById(id);
now again, as we already did that before, in the place of "id" just type in "R.id." hit ctrl+space and chose the "TextView"
Now, that You have defined it here, dosent mean that It will give you desired output....
You just have created an intent and have defined it and initialised it in the last java file.
But there is no-one to recieve that intent ! so, start typing the following:
And, in place of text, start typing "getI" and press ctrl+space. put a fullstop, type "getE" hit ctrl+space, put a fullstop again, start typing "getS", ctrl+space again now in the "()" put the string that you have defined in the last java file. since I have defined it as "thetext" i will type that in the "()" like this:
Code:
tv.setText(getIntent().getExtras().getString("thetext"));
Click to expand...
Click to collapse
Now, its done..... BUT.... ! .... AndroidManifest.xml
you didnt touch it till now. we have to register every activity there. or else, the app will cause a FC error. (Force Closes)
Now, open up the Androidmanifest.xml
go to the text editor :
and in the end before--> "</application>" add this
Code:
<activity
android:name="com.blksyn.explicitintents.SecondActivity">
</activity>
Click to expand...
Click to collapse
Now, its done. Lets start the emulator and Check this if it works !
Go to AVD Manager like this:
Start the AVD emulator.
click on run: and click on run again xD. Click on okay.
Bingo ! you have created an app which declares Explicit Intents and added a function to activities to catch that intent !
How to Make Android Apps: Explicit Intents
Click to expand...
Click to collapse
Implicit Intents
Implicit Intents
Now, you must have seen some applications with a "share" button. By clicking on this button, you can share a particular image/video/audio/etc....
What does that application actually do is send a message to other applications to search for the applications capable of handling such type of job. Then it pops up the list of such apps to the user. Now we can also have that list contain our app too !
Here is how.
Create a blank project. I gave it the name as "Implicit_intents". But you can choose whatever you want
Open up the "AndroidManifest.xml" file. (plz dont expect me to show how, cuz i have already shown that earlier and you should know that by now)
You will see something like this
Copy this from the main activity
Code:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
paste it again after the </intent-filter>
and change it to this
Code:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
NOTE:
Code:
<action android:name="android.intent.action.SEND" />
(self explainatory)
Click to expand...
Click to collapse
Code:
<category android:name="android.intent.category.DEFAULT" />
This tells the android system waht the category of the intent is. If you dont know what the category really is, you should keep it DEAFAULT.
Click to expand...
Click to collapse
Code:
<data android:mimeType="image/*" />
This tells the Android system, What type of data can the application "SEND" (* reference to the first one). and "data/*" means that the application can handle any type of imge. Jpeg, png, bmp, etc....
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Click to expand...
Click to collapse
So, this is how your AndroidManifest.xml should look like.
Now, go to the xml of your main activity and get rid of that text view. and add an "ImageView" from "Images and media" tab on the left
Now, go to your main java file and give a refernece to that ImageView
NOTE: "iv" is just a name given to the ImageView. so, you can change it if you want. But you will have to adapt to it and make changes in the steps accordingly.
Import the image view thing and add a cast by hitting ctrl+space
Now that you have specified the ImageView, you now have to set the ImageView to show the image the user wanna send. so, start typing in "iv.setImage" and press ctrl+space.
Now, since the image is IN the intent sent by the gallery after the user clicks the share button, we have to "get" the "EXTRAS" from the intent. So, start typing in in the "()". "getInt" press ctrl+space put a "." again type "getExt" choose the only option available, put a "." again and type "get" choose the first option. now, for the key, we are gonna use a constant from the INTENT class, that is called "EXTRA_STREAM". So ,just start typing in "Intent", put a ".", type "extra_" and choose "EXTRA_STREAM".
This "EXTRA_STREAM" is nothing but the "URI" to the image the user wants to send. You will have an error now in the line even after putting a ";" in the end. so press the quick fix combo "ctrl+1" and add a cast to (URI).
Click to expand...
Click to collapse
Now, you have successfully built an application that can handle the "share" kind of intent. now if you run this app in the emulator, you will probably have an FC. Since the app does not have any intent to process during the launch, it will FC. but if you go to gallery and click on share, you will get this app in the list. And also, if you click on this app, you will see the image you wanted to share.
So, this ends our chapter of Implicit Intents. You can now use your imaginations and use the combos of the previous and this chapter to build a pretty good basic app ! and the credit will be yours ! But dont forget to thank me for my efforts. haha... and also if i help you in some place.
And last but not the least in this chapter, If you have any questions, post a reply in this thread you will surely be answered :good:
How to Make Android Apps: Implicit Intents​
Click to expand...
Click to collapse
Widgets
I am going to teach you how to make a widget.
This widget will go to a specified site !
So , make a new android application in eclipse
name it whatever you like !
Click on File >> New >> Android Project
Fill in the details as you wish.... and click finish.
After you make a Project. You will get A full working Hello world Application. Now, modify the activity_main.xml in the graphical part like this
You will get something like this:
Now Open Up the AndroidManifest.xml. and remove this part:
And add this part:
make a new xml file by clicking
. and change Resource type from Layout to "AppWidget Provider" and now click Finish
Note: This Will be your android:resource file. highlighted in the previous image.
Now Open up that xml. You will find it in the /res/xml directory. you will get something like this:
Now click on the "red" underlined part. you will get something like this:
Now, Basically we are making a 2x2 widget. You need to specify that somewhere right ? That is the place. but how do you specify ?? It can be calculated using this formula:
Code:
the min width =
[(number_of_cells) * 74] - 2
2x2
min widht = [2*74]-2 = 144
min height = 144 ! :)
so, fill in the details like this:
Now, the layout part of the widget is complete. What we want to do is the JAVA thing now. So, open up the MainActivity.java
Double click the java file and you will et something like this
since we Are making a widget, We cannot have Much functions in here. Unlike activities(which have loads of functions in it) widget restricts us to very few. So, we are not going to need all the stuff You are seeing in java file. so do one thing. delete all the things. Here is how it shoud look like:
Now, Since We are not making a regular activity, We are not going to extend activity. Now we are going to extend the "AppWidgetProvider"
Code:
public class MainActivity extends AppWidgetProvider {
Now "AppWidgetProvider" Does not allow "OnCreate" Methods. what we are allowed is onUpdate Method, Since this is going to be called every single time our widget updates (N/A in this widget, but still you have to write it)
In that method, start typing
Code:
onUpdate
now press ctrl+space (windows only)
You will have something like this:
Code:
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
// TODO Auto-generated method stub
super.onUpdate(context, appWidgetManager, appWidgetIds);
}
In this class you have to define everything. Now what we are going to do is we will have to define a for loop:
Code:
for(int i = 0; i<appWidgetIds.length; i++){
}
Now first thing in this for loop, we are gonna have to refer to our current appWidgetID. so,
Code:
int ID = appWidgetIds[i];
Done! now wahat we are goingg to do with this widget ??
ANS: We are going to launch a web site b opening our browser.
Okay, so how are we going to do it ??
Yes, exactly. like we did it before, we are going define an intent, like this:
Code:
Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse("URL_OF_YOUR_WEBSITE"));
Now, It still isnt going to launch anything. What we have to do, is, set a "PendingIntent".
A pending intent is actually an intent which gives access to, um, ur app (widget, in this case,). so, start typing in
Code:
Pending
press ctrl+space. name it what you want. then put " = " . again type "PendingIntent." and press ctrl+space and select this:
Code:
getActivity(context, requestCode, intent, flags)
Now, for context, it has olready defined in your context (onUpdate method).
requestCode = flags 0 (we aren't using them here)
and for intent, put your intents name like I've put in "in". it will look something like this:
Code:
PendingIntent pen = PendingIntent.getActivity(context, 0, in, 0);
NOW, SINCE THIS IS A WIDGET AND NOT A SIMPLE, REGULAR ACTIVITY, WE CAN'T USE THE "findViewById(id)" THING HERE, WE HAVE TO USE "RemoteViews" since these views are
in the widget and not public.
So, we are going to create new instance of this
type in,
Code:
RemoteViews view = new Re
and press ctrl+space an choose this:
Code:
RemoteViews(packageName, layoutId)
for package name:
for layoutId:
Code:
R.layout.activity_main
now, after this, like we set onClickListener, We have to set onClickPendingIntent
like this:
Now, give respective arguments in the brackets. The final thing should look like this:
Code:
view.setOnClickPendingIntent(R.id.imageButton1, pen);
NOW, Last thing. it is to set up an "appWidgetManager"
so, Start typing:
and give the respective arguments.
final MainActivity.java should look like this
It wil Never launch a browser yet,, think why ???
We havent yet given up the permissions yet !!!
So, open up the AndroidManifest.xml
Go to permissions tab, youll see something like this:
click on Add.
edit like this.
Click to expand...
Click to collapse
Now, its done. Lets start the emulator and Check this if it works !
Go to AVD Manager like this:
Start the AVD emulator.
click on run: and click on run again xD. Click on okay.
Bingo ! you have created aWidget !!
Audio/Video and multimedia
Audio
In this one, i will tell you how to use the "raw" folder to play audio(s) from the folder using MediaPlayer thingy. Okay. So now open up Eclipse. and start a new Android Project.
Click on File >> New >> Android Project
Fill in the details as you wish.... and click finish.
After you make a Project. You will get A full working Hello world Application. now, modify the MainActivity.xml in the graphical part by adding a button to it and save it.
Now, in the project, right click on res folder, new>>folder. name the folder as "raw". THEY ALL SHOULD BE IN SMALLS. NONE OF THE LETTER SHOULD BE IN CAPS
Now, have a short mp3 file like the one in attachments, and drag it to the newly created folder.
Now, its all set, what our app will do is it will play that short mp3 file i the "raw" folder as soon as we press that button. Now, for that sake we are going to use MediaPlayer class. Open up the MainActivity.java fir this.
navigate to the .java files -->
Double click the java file and you will et something like this ( gibberish... if you dont like java like me )
we need to define the field and the "Button" from the first activity !
NOTE: as we advance in the tutorial, i will assume that you have done it from the start, hence i will not show such small things everytime, to make the tut short, sweet and simple. refer the first tutorial for this step.
It should look like this:
Code:
Button b = (Button) findViewById(R.id.button1);
Now that you have defined the button. Now you will have to set an OnClickListener for that button. so the it allows User to go to the second activity.
now start typing
b.setOnclick... press ctrl+space and choose onClickListener. It will automatically place you in the "()" type there --> new OnClickListener press ctrl+space. you will get something like this
you will get an error. so go to the place ( marked red in the pic and put a semi-colon )
now, in the following method,
Code:
public void onClick(View arg0) {
// TODO Auto-generated method stub
}
start typing the following
Code:
MediaPlayer mp = MediaPlayer.
press ctrl+space and choose this
It will automatically place you in "context".
NOTE:
context == "The java file that is creating the Intent";
resid == " The id of the resource (here, id of the mp3 file in the folder"raw")";
so, edit it this way
Code:
MediaPlayer mp = MediaPlayer.create(MainActivity.this, R.raw.beep);
NOTE:
MainActivity == "The java file that you are editing";
R.raw.beep == "Here , the name of the mp3 file in my "raw" folder is beep, it can be according to you";
So, we have just defined the mp class.
BUT, who is invoking it ?
Nobody, we need to invoke it ourselves. here, there is no relation or job to be done by "intent" like we did in earlier tutorials MediaPlayer class is totally different....
We need to do this in order to invoke.
Code:
mp.start();
NOTE:
mp == "the name that i gave to MediaPlayer object";
Code:
MediaPlayer [COLOR="SeaGreen"]mp[/COLOR] = MediaPlayer.create(MainActivity.this, R.raw.beep);
.
Click to expand...
Click to collapse
Save it and run it on your AVD
Now, its done. Lets start the emulator and Check this if it works !
Go to AVD Manager like this:
Start the AVD emulator.
click on run: and click on run again xD. Click on okay.
YAY ! it works !! click on that button
Click to expand...
Click to collapse
Video
In this one, I will tell you how to play video(s) which are already in your sdcard. Okay. So now open up Eclipse. and start a new Android Project.
Click on File >> New >> Android Project
Fill in the details as you wish.... and click finish.
After you make a Project. You will get A full working Hello world Application. now, modify the MainActivity.xml in the graphical part by adding a button to it and save it.
Now, place a video in ur sdcard (wherever you want, will explain later).
NOTE:
Video should be in mp4 format, as android has built-in encoders for that.
Now, its all set, what our app will do is it will play that short mp4 video file in the sdcard as soon as activity is invoked. Now, for that sake we are going to use VideoView class.
Go to res/layout/activity_main.xml
Delete the text view and add a VideoView:
Save it
Open up the MainActivity.java like this.
navigate to the .java files -->
Double click the java file and you will see something like this ( gibberish... if you dont like java like me )
we need to define the VideoView class.
NOTE: as we advance in the tutorial, i will assume that you have done it from the start, hence i will not show such small things everytime, to make the tut short, sweet and simple. refer the first tutorial for this step.Its just like defining a button
It should look like this:
Code:
VideoView vv = (VideoView) findViewById(R.id.videoView1);
Now that you have defined the VV. Now you will have to set properties of the VV so that we can play the video and offer controls(rewind, play/pause, fast fwd) and etc.
now start typing
vv.setV... press ctrl+space and you will get something like this
choose that, and enter string path:
Code:
vv.setVideoPath("/sdcard/path/to/video.mp4");
note that the /sdcard is a must. it can also be written as /mnt/sdcard/ however. not all phones have this functionability.
so, its better to write /sdcard.
Since we need to have controls while playing the video, we need to instantiate that first, so,
Code:
vv.setMediaController(new MediaController(this));
Disstection:: MediaCOntroller, Name explains itself. since we didnt create the MediaController anywhere, we made a new controller
and passed in the context as "this"
-_- "java". lol
Now that we want to start it as soon as the activity is started.
we add this:
Code:
vv.start();
we also do not want the backlights to be down while playing the video so,
Code:
vv.requestFocus();
Save it and run it on your ACTUAL ANDROID DEVICE.
NOTE: Please do not test this on emulator.[/size]
Click to expand...
Click to collapse
Images and Camera
In this one, i will tell you how to use the Mediastore and device's camera to get the picture/photo from the camera. Okay. So now open up Eclipse. and start a new Android Project.
Click on File >> New >> Android Project
Fill in the details as you wish.... and click finish.
After you make a Project. You will get A full working Hello world Application. now, modify the MainActivity.xml in the graphical part by adding a button to it and save it.
Now, its all set, what our app will do is it will click a picture using device's camera, and give you the picture. so, open up your main_activity.xml and delete the TextView. Add a button (which will initiate device's camera) and an ImageView (which will show you the pic that the user will click).
Then open up your MainActivity.java
navigate to the .java files -->
Double click the java file and you will et something like this ( gibberish... if you dont like java like me )
we need to define the field and the "Button" from the first activity !
NOTE: as we advance in the tutorial, i will assume that you have done it from the start, hence i will not show such small things everytime, to make the tut short, sweet and simple. refer the first tutorial for this step.
It should look like this:
Code:
Button b = (Button) findViewById(R.id.button1);
Now that you have defined the button. Now you will have to set an OnClickListener for that button. so the it allows User to go to the second activity.
now start typing
b.setOnclick... press ctrl+space and choose onClickListener. It will automatically place you in the "()" type there --> new OnClickListener press ctrl+space. you will get something like this
you will get an error. so go to the place ( marked red in the pic and put a semi-colon )
now, in the following method,
Code:
public void onClick(View arg0) {
// TODO Auto-generated method stub
}
Make an instance on Intent
Code:
Intent intent = new Intent();
now in the arguments, pass in "android.provider.MediaStore.ACTION_IMAGE_CAPTURE"
this allows us to actually launch the camera app(s) installed on the device. so as to
get a captured image.
Till now, we started intents just like starting any activity.
but in this particular case, we are starting another activity,
with an expectation of recieving some data back.
that is, result.
so, next, start typing "startAct...."
and choose this
Code:
startActivityForResult(intent, requestCode)
NOTE:
intent = "The Intent that we already created"; (since I've named it as "intent" , ill pass in
"intent")
requstCode == "we will not be using this, so, skip it, pass in a zero";
Code:
startActivityForResult(intent, 0);
now then, we are expecting a result.
so, we must set a reciever for it, right ?
lets do that first and then play with the ImageView
so, after the method, make a new method, start typing
Now, we have set the reciever.
now, we need to give an instance of ImageView.
so, declaration has to be before the onCreate method.
and definition can be in both the methods.
so, declare an ImageView outside the onCreate method
Code:
ImageView iv;
and in the onCreate method,
Code:
iv = (ImageView) findViewById(R.id.imageView1);
and lastly, in the onActivityResult method,
declare and define a bitmap, which will save the clicked pic.
Code:
Bitmap bm = (Bitmap) data.getExtras().get("data");
now, bm will save the clicked pic in itself.
and to display it, we use iv. so type in this:
Code:
iv.setImageBitmap(bm);
At The End, this is how the MainActivity.java should look like:
Code:
package com.example.camtut;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
public class MainActivity extends Activity {
ImageView iv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
iv = (ImageView) findViewById(R.id.imageView1);
Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 0);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
Bitmap bm = (Bitmap) data.getExtras().get("data");
iv.setImageBitmap(bm);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
[/hide]
Click to expand...
Click to collapse
Now, its done, Check this if it works !
P.S. do not use emulator for this, test it on actual device
Click to expand...
Click to collapse
https://www.youtube.com/watch?v=HpmjwddBdxY
Click to expand...
Click to collapse
Apology for the delay (over one year )
but I will start writing this off afresh will include something more too
stay tuned
Regards,
Nachiket.Namjoshi
Thank you all of you for your support...
Since there are MANY time issues right now,
I will be updating this guide whenever I get time...
I hope you all understand.​
Reserved for GPS and stuff
Sent from my GT-S5360 using xda app-developers app
5 more to be reserved for the sake of finding them on one place
Sent from my GT-S5360 using xda app-developers app
4 more
Sent from my GT-S5360 using xda app-developers app
3 more
Sent from my GT-S5360 using xda app-developers app
2 more for really important stuff
Sent from my GT-S5360 using xda app-developers app
Done.... it's the last one
Sent from my GT-S5360 using xda app-developers app
great bro. You reserved a lot
thanks
The JRE and JDK link is not working. Also downloading the JDK alone contains the JRE package, and downloading JRE separately is not needed.
Link: http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html (JDK6 is recommended to use with Android development, as JDK7 has compatibility issues)
coolsandie said:
The JRE and JDK link is not working. Also downloading the JDK alone contains the JRE package, and downloading JRE separately is not needed.
Link: http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html (JDK6 is recommended to use with Android development, as JDK7 has compatibility issues)
Click to expand...
Click to collapse
Thanks bro... I did it from the xda app. So plz forgive...
Sent from my GT-S5360 using xda app-developers app
nice work on it....cool bro but update links

[APK][Xposed] resOverloader - Overload applications res files

Hello community,
I'm very glad to share my first trial of development which ran successfully for me and hope this will be useful for the rest.
I'm a big fan of a few chinese apps (baidu cloud, weiyun). Previously I was able to decompose and translate these apks to english until vendors injected apk signature validations into their apps. I even used these apps in foreign language but the experience were annoying. So I decided to translate these apps with some development. Eventually I came across resXploit by WisdomSky which give me a clue and I started this and it works :good:.
Basically resOverloader overloads strings.xml file for any apk (application). Source code is hosted on github for other devs to incorporate other resources as well. I'm not experienced dev and sharing this here for others and further development.
How to setup
Extract strings.xml from your target apk using apktool. read more
Translate strings.xml to your language. (I had developed a tool for it and would share it later)
Now create resOverloader folder in sdcard.
Find your app full qualified name in applications under settings and create a folder with app full name. (eg. com.baidu.netdisk)
Now copy the translated strings.xml to app folder inside resOverloader.
Restart your phone and it is done.
Hope this will help starters and requesting experience devs to add arrays.xml to this.
Github: https://github.com/babuilyas/resOverloader
Change log:
2.0 : rebuilt with targetSDK 14 and it should work for 2.2+ now. pls confirm.
Thank you for reading... Cheers.
reserved
Thanks all for praising my work. Here is my translation utility which can help you translate any xml file with auto fixing of literals and escapes within source text.
How it works!
The first step is, hand your xml file (strings.xml). Read OP
Run XML_translator.exe and select the file to translate. (language selectors are not working now and hardcoded to CN->EN)
Click Start translating.
The utility will take time and depends on source file length. At the end you will see strings-new.xml file. Rename it to strings.xml and use it with resOverloader.
I would soon remove the hardcoded part to enable multilingual translations.
Thank you very much.
I made a request for this feature in the request thread sometime back, but no developer was interested. . I will try it now and report back.
Edit: IT WORKS. My translated texts show up.
However, I would like only to see the translated texts when the system language is switched to that language only. So I could see original English texts when the system language is set to English.
nqk said:
Thank you very much.
I made a request for this feature in the request thread sometime back, but no developer was interested. . I will try it now and report back.
Edit: IT WORKS. My translated texts show up.
However, I would like only to see the translated texts when the system language is switched to that language only. So I could see original English texts when the system language is set to English.
Click to expand...
Click to collapse
OP could add localized string switching by checking filename suffix against Locale.getDefault().getLanguage(). So if you wanted to add multiple languages to an app, you'd just need strings-en.xml, strings-it.xml, etc etc
Yay , now yunpan/tencent/baidu drive shall all become translated
I was thinking about it latest two weeks and someone made it! Impressive!
nice work.. i'm waiting the translate strings tool..
This is really impressive.
Thank you very much for you work m8.
I'm on stock N4, and can't get this module to work. I decompiled and translated strings.xml, but there's no change in app. Should be translated strings.xml compiled back, before putting it to sdcard?
Great module, thx for your work. Also very interested in your translation tool. Also been thinking a lot about how to automate APK translation but to no avail.
Some features that i was thinking that can be added BUT not sure if they can be implemented:
- Load list of installed apps via GUI;
- Decompile the apk and extract the strings to a full app name folder (No idea if apk can be decompile from within an app)
- Tell user to edit the strings.xml
- Check if strings.xml was edited and in case it was prompt for reboot.
joluke said:
Some features that i was thinking that can be added BUT not sure if they can be implemented:
- Load list of installed apps via GUI;
- Decompile the apk and extract the strings to a full app name folder (No idea if apk can be decompile from within an app)
- Tell user to edit the strings.xml
- Check if strings.xml was edited and in case it was prompt for reboot.
Click to expand...
Click to collapse
I'm new and still learning android development. Im planning to integrate translating utility inside this app and would allow users to translate any app on the fly on the device.
geekon said:
I'm on stock N4, and can't get this module to work. I decompiled and translated strings.xml, but there's no change in app. Should be translated strings.xml compiled back, before putting it to sdcard?
Click to expand...
Click to collapse
make sure, you have copied translated xml in resOverloader\[your app full name]\strings.xml in internal memory (sdcard).
Bug: translated apps show an escaping slash-chars.
Can you add a possibility:
- to download and update of translation resources from github for all installed apps? In such case you should only define a resource location URL.
- for localization of res/layout/*.xml & res/xml/*.xml & etc
Is there a opportunity to use also preferences.xml?
babuilyas said:
make sure, you have copied translated xml in resOverloader\[your app full name]\strings.xml in internal memory (sdcard).
Click to expand...
Click to collapse
I tried with 4 apps, the results are as follows:
- AppSetting (xposed module): OK
- Nova Launcher: Partially OK, many strings remain in English
- Omniswitch (OmniRom): Not working (all texts are still in English)
- Transdroid: OK
:highfive:
nqk said:
I tried with 4 apps, the results are as follows:
- AppSetting (xposed module): OK
- Nova Launcher: Partially OK, many strings remain in English
- Omniswitch (OmniRom): Not working (all texts are still in English)
- Transdroid: OK
:highfive:
Click to expand...
Click to collapse
Share Xposed log and thanks for testing this app.
I saw the log, but didn't find any FC. See if there is anything in translated xml.
Benko111 said:
Great module, thx for your work. Also very interested in your translation tool. Also been thinking a lot about how to automate APK translation but to no avail.
Click to expand...
Click to collapse
i have some more ideas, so i will fork your module and add my ideas.
babuilyas said:
Share Xposed log.
Click to expand...
Click to collapse
Please have a look
https://m.app.box.com/view/f_16953900439
Sent from my Nexus 4
Very pleased.. Share it with all..
Sent from my LG-GEEB using Tapatalk

Google Chrome User Agent Android 7.x

Hi,
how can i Set Chrome User Agent to Desktop or chromebook on Android 7.x ?
Old User Agent Apps won't work on 7.x
I need to Set Chrome to Desktop view always on
Put a file in Data/Local called 'chrome-command-line', put this text in
chrome --user-agent="Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36" -force-device-scale-factor=2
Permissions 644, you can change the scale-factor to suit.
Sorry but this is Not working anymore on 7.x
Nobody ?
Just wanted to bump this as I'm also looking for a solution.
This has been bugging me for for a few days, very frustrating, seems like Chrome doesn't read the command line files in Nougat no matter where they are located, what they are called, or how you invoke the application. So I did the next best thing...
I grabbed the latest Chromium source code and modified user_agent.cc so it spits out a desktop UA instead. Cross compiling was a bit of a lengthy process, around 4 hours, but it works perfectly. The code alteration was quite trivial, I know this doesn't really help anyone here with a quick fix, and I really can't see Google adding a permanent desktop mode any time ever.
To make the change, just edit the following and rebuild:
<path>/src/content/common/user_agent.cc
PHP:
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
const std::string& product) {
// Derived from Safari's UA string.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
std::string user_agent;
// base::StringAppendF(
// &user_agent,
// "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
// os_info.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR,
// product.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR);
// return user_agent;
return "<Insert desired user agent here>";
}
dtchky said:
This has been bugging me for for a few days, very frustrating, seems like Chrome doesn't read the command line files in Nougat no matter where they are located, what they are called, or how you invoke the application. So I did the next best thing...
I grabbed the latest Chromium source code and modified user_agent.cc so it spits out a desktop UA instead. Cross compiling was a bit of a lengthy process, around 4 hours, but it works perfectly. The code alteration was quite trivial, I know this doesn't really help anyone here with a quick fix, and I really can't see Google adding a permanent desktop mode any time ever.
To make the change, just edit the following and rebuild:
<path>/src/content/common/user_agent.cc
PHP:
std::string BuildUserAgentFromOSAndProduct(const std::string& os_info,
const std::string& product) {
// Derived from Safari's UA string.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
std::string user_agent;
// base::StringAppendF(
// &user_agent,
// "Mozilla/5.0 (%s) AppleWebKit/%d.%d (KHTML, like Gecko) %s Safari/%d.%d",
// os_info.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR,
// product.c_str(),
// WEBKIT_VERSION_MAJOR,
// WEBKIT_VERSION_MINOR);
// return user_agent;
return "<Insert desired user agent here>";
}
Click to expand...
Click to collapse
Would it be possible for you to share the apk? This is frustrating me beyond belief after I moved to Nougat.
Found a solution for this problem, it was caused by a SELinux context which blocked read access to the command line file.
Download this script and copy it on the SDCard.
Install Android Terminal Emulator, then enter:
Code:
su
sh /sdcard/chrome.sh
- Testing 7.x fix. https://play.google.com/store/apps/details?id=com.linuxjet.apps.ChromeUA
jpeterson said:
- Testing 7.x fix. https://play.google.com/store/apps/details?id=com.linuxjet.apps.ChromeUA
Click to expand...
Click to collapse
Thank you. Is this working for anyone?
cobram3 said:
Thank you. Is this working for anyone?
Click to expand...
Click to collapse
It is available on the play store. I can not guarantee this will work, but I have tested it on my 7.x devices and 8.x devices and it is working on them.
Does not work on my OnePlus 5T on Android 8.0 rooted with Magisk.
Neither does the script posted above.
Any other ideas? I'm sick of manually selecting "view non crippled site" every time I open any webpage.
"Mobile" sites need to die!
EDIT: I figured it out, I needed to set the /data/local directory to be readable by all. (The script above already got the file permissions right for the chrome-command-line file, just not the directory it lived in). After that the user agent string seems to be working as it should and I can actually view useful webpages again!
Well, so much for that.
I wiped my phone and started over, and the same steps I used last time have no effect this time. I'm stuck in mobile website hell.
Anyone with any idea how to fix this?
EDIT: This seems to be related to the file permissions issue still, but I'm not sure how to fix it. When I'm not root, I get permission denied when I do an ls on the /data/local directory, despite that directory, and all the ones above it, being set 755. So whatever is blocking me from being able to ls that directory is also likely blocking the ability for chrome to read that file and behave like a useful web browser instead of a completely crippled one.
ve6rah said:
Does not work on my OnePlus 5T on Android 8.0 rooted with Magisk.
Neither does the script posted above.
Any other ideas? I'm sick of manually selecting "view non crippled site" every time I open any webpage.
"Mobile" sites need to die!
EDIT: I figured it out, I needed to set the /data/local directory to be readable by all. (The script above already got the file permissions right for the chrome-command-line file, just not the directory it lived in). After that the user agent string seems to be working as it should and I can actually view useful webpages again!
Click to expand...
Click to collapse
You can create a "chrome desktop"widget with that app,only by this way,it seems to work.
Unfortunately that only works for opening the browser and does nothing for links clicked in our applications.
Why do developers of websites hate mobile users? This isn't 1998 anymore, people want to access websites from their phones! We shouldn't have to resort to such ridiculous lengths to enable such basic functionality as a working web browser!
https://forum.xda-developers.com/showthread.php?t=1811101&page=13 #128
That helps quite a bit.
Now of course I've run in to another problem. AMP. google assistant and related products love to push AMP pages instead of websites, and chrome won't open them in desktop mode, only in mobile mode. I wonder if there's some way to convince Google assistant to behave and link to real webpages?
*sigh* it's amazing how far companies are willing to go to cripple their websites!
EDIT: Found it! DeAMPify in the play store translates all those external programs (like the google feed) to non amp versions before passing them to the browser.
With enough steps and work-arounds you too can have a functioning web-browser on your smartphone!
I'm here to confirm Wootever's script working on [ROM][8.1.0][STABLE][OFFICIAL][TREBLE] AospExtended ROM V5.4 [Z2 PRO]. I had already created the chrome-command-line file via file explorer and set permissions to 755, but it wasn't working. Customized the UA string to my liking, btw (X11; Linux Arm64).
The way G00gl€ is developing Chrome is fLIck1ng annoying, this is basic functionality being set aside because fLIck you. Latest Android Chrome versions (63 to 66) are a piece of sh1t imho.
Cheers
Wootever said:
Found a solution for this problem, it was caused by a SELinux context which blocked read access to the command line file.
Download this script and copy it on the SDCard.
Install Android Terminal Emulator, then enter:
Code:
su
sh /sdcard/chrome.sh
Click to expand...
Click to collapse
Does anyone still have this file?
Reupload
Reupload ulozto.sk/file/R55e4UbG3ppA/chrome-sh

Categories

Resources