pop up window when message selected in other app - Android - java

Is it possible to pop up a window for a selected text within another android app ?
for example a user is using some pdf reader and selects a word and a small window pops up that provides the options to highlight the text or Define and ... , I want to know is it possible to add another option to that window (or add a small window next to that) that defines the meaning using my dictionary app, not the pdf reader's dictionary?
basically I want to know if it is possible to have the user to use my dictionary app for all his needs , surfing web, reading pdf , looking up words directly ..

No, its not possible.
Only way of do that if you upload your app to Google Play and shared the options with other apps (using PendingIntents and Broadcast actions), but the code of other apps must use your code, you can not modify other app installed.

If I have understood your question correctly then NO.
It is not possible to edit the behavior of other apps with your own since then you would have to edit that apps source code. As far as I know the system does not provide any overhead setting for what your asking as it does for sharing things whith different apps (email, social media etc.)

Related

Add a "Share/Send To" capability to an Android app

I am developing an Android app that has the feature of converting a video to an audio file.
I want to add a feature that makes the user able to enter his studio, then when they click on the video-share option (to share the video), to find my application icon at the bottom. Without the need to open the application.
How can I do that?
the answer is this share/receive guide
thanks VC.One that is exactly what i need

Updating java code from server

I have an app that has an activity which allow users to download PDF files by selecting a PDF and clicking the download button.
The issue is: I don't want to always ask users to update the app when there's a new material available.
Is there a way I can update the .java code without always asking users to update the app?
Wrong design point.
You have probably hardcoded the PDF / file names in your Java application.
When these values are supposed to change, then well: don't hardcode them.
Instead you create a server side service that lists the available PDFs. And then your app uses that service in order to acquire that information.
Anything that is "dynamic" must not be hardcoded in your app itself. Instead your app knows how to fetch that piece of information from somewhere.
When the source code of your application changes, your users have to upgrade the app. It is that simple. The other way round: if you know about "changes" to your app that need to work without upgrading the app, then well: you have to design the whole app around that requirement.
A first starting point / further reading: see here.

Getting user behavior on the Android Phone (App History, Browse History etc)

Is it possible to get the user behavior on the phone (for example Alpesh has an Android phone and he uses multiple apps, browser YouTube etc). Whatever he is doing on the phone I want to get all those things from behind (which apps he has installed, which app he opens and what he search on the phone, All these data I want to get programmatically so what all can be get in android).
For now I am aware that installed apps list can be get easily but I want to get usage history and what he do all on mobile.
This is not a code solution, but an answer to your question, so you can get start some where.
In my opinion your question title are asking about two things.
(part 1) Getting User Behavior on the Android Phone (part 2)(App History, Browse
History etc)
1- First part Getting User Behavior on the Android Phone:
There is a concept called context awareness. Short described; it is about gathering different information from the phone, like light sensor, motion sensor, sound, location or even user behavior etc. and depending on your app requirement and the gathered information:
You could send these information over cloud data store for statically usage
You could make your phone doing (behavior) different things depending on location, motion or what ever.
etc.
For context awareness it is an open area for pervasive computing research. And it is not just few lines of code to write, it is typically a complete solution depending on requirement. Example I have built a context awareness application to gather noise collected by phones from different locations for research purpose inspired from this framework, but I am pretty sure you can find other frameworks or even build your own, as I did in my case.
The mentioned framework has some examples.
2- The second part is about App History, Browse History etc.:
This is possible, but you still need to build a peace of software (App) to collect all these information (logs) from the phone. Hereafter you can make phone act on different conditions and/or again send it over a RESTful API over cloud service data store, there is no limit for it.
The problem is, there is no thing out of the box for your requirement. Even if you find frameworks you still need to research it and further work on it.
You can find different examples for your requirement, like to collect browser history, you can find SO question here:
Get browser history and search result in android
Or get list of installed application:
How to get a list of installed android applications and pick one to run
My point here is you need to solve small goals at a time and put your knowledge together at the end.
Both 1 and 2 can also be related to each other, depending on your achievement.
Conclusion
Make a goal to your project.
Define the main requirements and tasks of your project.
Research your options (Technology, Cost, Target Audience, What data I can or I should not collect, what is possible to collect, what is the limits, Privacy issues etc.).
Split your project in small assets and try to solve small problems/goals.
Finally you would be able to put the puzzles together and build your final application
but i want to get usage history and what he do all on mobile
This is not possible and shouldn't ever be possible. Each app is sandboxed by Android so apps cannot inspect what other apps are doing. Think about it, you wouldn't want apps to be able to intercept private information such as banking details.
Every app is isolated from the other ones. Unless you develop a system signed app, you will not be able to gather all that data.
What you could do is to develop your own Android Rom where you then develop your data collection the exact way you want. Then you need to distribute your rom, which is another story...

Creating a landing page similar to twitter app and others

I am wanting to make a reusable 'landing page' activity similar to like the activity when you first launch the official twitter app, facebook, or google io app, etc. Reusable is really the key here I would like for the activity to dynamically populate its gridview with the other activities in the application.
Is it possible to parse through the android manifest file to find my other activities? If so is it also possible to add my own xml attributes to the manifest file to distinguish which activities should show up in the gridview?
Or, is there some other way to find all existing activity classes in the package? Is there a way in java to look for any Class in a package that implements a particular interface?
edit: here is a screen shot as per request
Is it possible to parse through the android manifest file to find my other activities?
No, but you can iterate over your activities via PackageManager and getPackageInfo().
If so is it also possible to add my own xml attributes to the manifest file to distinguish which
activities should show up in the gridview?
You should be able to use a <meta-data> element to point to an XML resource file that contains your extra data, just like app widgets and searching do. Use loadXmlMetaData() to access the contents.
That being said, I agree with Juri -- you're using a Buick to swat a fly here. Having a reusable dashboard activity is great -- working out the details of one is on my 18,000-item to-do list. Having one that tries to dynamically populate itself seems overkill.
I guess what you want is a dashboard. For ideas on how to implement it you could look at the source code of the Google I/O android app, more specifically at the activity_home.xml.
Parsing the manifest.xml could be an idea although I'm not sure whether you're able to access it. Honestly, being on a mobile where you want to use as little resources as possible I'd suggest you to reference your items hardcoded in the xml file, just as they did it on the Google I/O app.
The reason is that you probably want to promote just the most important activities of your app, not the detail views of a list or some custom popup alert which is also registered in the manifest and would therefore be difficult to distinguish from others.
How many activities do you have to put on the dashboard? Will the user ever be able to promote inactive activities because they want them? I think you have to consider those factors as well. Otherwise, you would weight the ones you want to show up first (different ways to do this) and then let them trickle into the dashboard.
As far as how to display which where, if you're using HTML/CSS then you could use a set width and a float model. Otherwise, just iterate through the list of promoted activities. I've done both in HTML/CSS dashboards I've done. It's just according to what your parameters are.
It's relatively easy to build a list in memory and loop from 1 to 6 assigning values to each of 6 locations on screen. Making them dynamically sized could be tricky.
Looking for more info to help you out, but not sure exactly how you're having issues. Unless you have something directly patentable, I would suggest showing code and what you're struggling with ...

Possible to 'layer' Android applications?

I know this in general is beyond the scope of SO, but I am looking for some basic yes/no info to see if it is even feasible to proceed... I am thinking about building and Android 'note-taking/annotation' app that runs 'over' other installed Android apps, such as the web browser for example.
Essentially, while the user is browsing, my app would be running in the bg as a service, and then they could activate it which would then essentially intercept user inputs and translate those on a transparent canvas over the web browser into lines, shapes, etc. The user could then take a screen-cap of their marking with the underlying web page, which would be stored to the sd card.
This is a very good idea and a great question, but sadly, I do not believe it is possible.
The way Android is designed only one Activity can have focus at a time, while a Service could run in the background, the user would not be able to interact with it. The user can only interact with the currently active Activity.
Again, love the idea, but it is sadly not supported.
You might be able to achieve this with the WindowManager service. You can then use that to call addView() with a view of type TYPE_SYSTEM_ALERT, or possibly TYPE_SYSTEM_OVERLAY (but see the notes in the documentation about taking input focus).
I haven't tried it myself, but I've seen several apps (often dictionary apps that translate whatever words you tap on) that do overlays, and they always seem to require the SYSTEM_ALERT_WINDOW permission.

Categories

Resources