Git Product home page Git Product logo

loklak_wok_android's Introduction

Loklak Wok for Android

Build Status codecov.io

Loklak Wok Android is a message harvesting peer for the loklak_server.

Users can also search tweets from the app, the displayed tweets are the latest tweets, tweets containing images and videos. Along with that, the app provides a tweet posting feature. Users can directly post the tweet from the app. Not only text, but images can also be tweeted from the app.

Screenshots of the app

Communication

Please join our mailing list to discuss questions regarding the project: https://groups.google.com/forum/#!forum/opntec-dev

Our chat channel is on gitter here: https://gitter.im/loklak/loklak.

Development Environment Setup

Clone the repository

$ git clone https://github.com/fossasia/loklak_wok_android.git 

Before you begin, you should already have the Android Studio SDK downloaded and set up correctly. You can find a guide on how to do this here: Setting up Android Studio

Setting up the Android Project

  1. Download the loklak_wok_android project source. You can do this either by forking and cloning the repository (recommended if you plan on pushing changes) or by downloading it as a ZIP file and extracting it.

  2. Open Android Studio, you will see a Welcome to Android window. Under Quick Start, select Import Project (Eclipse ADT, Gradle, etc.)

  3. Navigate to the directory where you saved the loklak_wok_android project, select this folder.

  4. Once this process is complete and Android Studio opens, check the Console for any build errors. Note: If you receive a Gradle sync error titled, "failed to find ...", you should click on the link below the error message (if available) that says Install missing platform(s) and sync project and allow Android studio to fetch you what is missing.

  5. Once all build errors have been resolved, you should be all set to build the app and test it.

  6. To Build the app, go to Build>Make Project (or alternatively press the Make Project icon in the toolbar).

  7. If the app was built successfully, you can test it by running it on either a real device or an emulated one by going to Run>Run 'app' or pressing the Run icon in the toolbar.

Libraries Used

The project uses lambda expressions and RxJava heavily. So, if you are new to these, the following resources would be helpful to get you started:

Contributions, Bug Reports and Feature Requests

This is an Open Source project and we would be happy to see contributors who report bugs and file feature requests submitting pull requests as well. Please report issues here https://github.com/fossasia/loklak_wok_android/issues.

Branch Policy

  • master All development goes on in this branch. If you're making a contribution, you are supposed to make a pull request to master. PRs to master must pass a build check on Travis.
  • apk This branch contains apks, that are automatically generated on merging the latest pull request.

Code Style Guidelines

For contributions please read the CODESTYLE carefully. An additional rule: Maximum 100 characters per line.

Try to remove as many warnings (yellow markings on the right side of Android Studio) as possible, It's not completely possible to remove all the warnings, but over a period of time, we should try to make it as complete as possible.

LICENSE

This is licensed under LGPL 2.1.

loklak_wok_android's People

Contributors

abishekvashok avatar adarsh-ideal avatar anandwana0011 avatar arundhatigupta avatar batbrain7 avatar brijeshshah13 avatar chiragw15 avatar daminisatya avatar dr0pdb avatar iamareebjamal avatar idealadarsh avatar jigyasa-grover avatar kapillamba4 avatar marcnause avatar mariobehling avatar mayank8318 avatar neelanshsahai avatar orbiter avatar pri22296 avatar riyasingh1004 avatar s2606 avatar shivenmian avatar simsausaurabh avatar singhpratyush avatar skrpl avatar sudheesh001 avatar vidyasonawane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loklak_wok_android's Issues

Backend returns HTTP code 504

I have noticed that most requests to the backend (http://loklag.org) return HTTP code 504 (gateway timeout).

I changed the logging in Harvester.java (line 276) to output a stacktrace to the log and I get this a lot:

D/PushThread: failed synchronous push to backend, attempt 0
java.io.IOException: Server returned non-OK status: 504
at org.loklak.tools.NetworkIO.pushString(Unknown Source)
at org.loklak.tools.JsonIO.pushJson(Unknown Source)
at org.loklak.client.PushClient.push(Unknown Source)
at org.loklak.android.wok.Harvester$PushThread.doInBackground(Harvester.java:263)
at org.loklak.android.wok.Harvester$PushThread.doInBackground(Harvester.java:244)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)

Tweet search suggestions now showing properly

  • Issue Type: Bug Report

Brief Description

Suggestions only get updated the first time SuggestFragment is opened i.e. its onCreateView is invoked. If the user goes from SuggestFragment to TweetHarvestingFragment or SearchFragment and navigates back, the suggestions are not getting updated.

Steps to reproduce

Navigate in the following way:

  • TweetHarvestingFragment (app opens) -> SuggestFragment (suggestions updated properly) -> Press back button for navigating back to TweetHarvestingFragment -> Again comeback to SuggestFragment (doesn't update suggestion)
  • TweetHarvestingFragment (app opens) -> SuggestFragment (suggestion updated properly) -> click on any suggestion -> SearchFragment -> press back button for navigating back to SuggestFragment (doesn't update suggestions)

Change package name and remove old implementations

Make the app ready for alpha release publishing.

  • Change package name from org.loklak.android to loklak.wok.android
  • Delete old implementations of Loklak wok and .jar files (present in app/libs).
  • Change License information in README.md file.

Add crashlytics

Issue type: Feature enhancement

Short Description

Add crashlytics for easy debugging and solving crash issues.

Add animations to TweetPostingActivity and restore state after orientation change

Issue Type: Enhancement

Short Description

The TweetPostingActivity doesn't open or close with animations. Also, the attached images and location is lost after an orientation change (user needs to select the images again).

Required Enhancement

While TweetPostingActivity is opened the activity should come from bottom to top animation and vice-versa while moving to another activity. The attached images and location data should be saved in a Bundle object in onSaveInstanceState callback so that it can be retrieved in on onViewCreated or onCreateView callback.

Add tweet search suggestion feature

As in twitter's app, there is a tweet search option, going to that option displays trending hashtags and topics in a RecyclerView. Display the trending tweet topics in a RecyclerView using Loklak's suggest API.

The sub-functionalities that are required:

  • Display suggestions in RecyclerView.
  • Clicking on the search icon in keyboard while using EditText, should navigate the user to TweetSearch activity (to be created later)
  • Store the fetched suggestions in Realm Database, for persistent data.
  • When user types in EditText, wait for 0.5 seconds and then search for matching suggestions
  • Add a swipe to refresh functionality.

Related twitter app image
18926442_1893321190955272_859147295_o

Add Tweet Posting functionality

Issue type: Enhancement

The following needs to be completed to solve this issue:

  • Post the tweet using public Twitter POST API endpoint.
  • Once tweet is successfully posted, use the data to create a JSONObject that matches the format of Loklak's push API endpoint.
  • Media can be attached with a tweet.
  • Add location to tweet
  • Send the posted tweet to LoklakServer using push API endpoint.

Tweet posting with media_ids fails

Parent issue: #41

Steps to post a tweet with media:

  1. Obtain media ID using POST media/upload twitter API endpoint: https://dev.twitter.com/rest/reference/post/media/upload-init (Media ID is obtained for small files, without using APPEND and FINIALIZE command).
  2. Use the obtained media ID in statuses/update(https://dev.twitter.com/rest/reference/post/statuses/update) by providing the media ID in media_ids parameter. This request throws an HTTPException 400, and with an error message:
{"errors":[{"code":324,"message":"Invalid media id 889241623330263044"}]}

Tried to test the request with twurl and an Webapp developed by a twitter team member (http://django-rest-apis.herokuapp.com/media/video), both of it throw the same error (mentioned above).

Searched a bit about this and found the following discussions:

A demo app that can be used to verify this error, link: https://github.com/SKrPl/TwitterMultimedia

Repo size very large because of previous apks.

The repo is very large in size. This is because previous apks are being stored in the git-history of the apk branch. We need to update the update-apk.sh file so that previous apks are removed from the repo history.

I will send a PR for this issue.

Apk in Apk branch not updating

The apk should be updated after every successful pull request but in the apk branch it displays the apk was updated around 4 months ago. There were PR's after that but the apk didn't update. Need to check apk-update script.

Add circular progress bars

Issue type: Enhancement

Short description

The tweet harvesting process (in TweetHarvestingFragment) takes some time to start. Currently, the blank RecyclerView is displayed. Similarly, if network connections are slow, the searched tweets are displayed after some time in SearchCategoryFragment.

Required Enhancement

Add circular progress bars in the above two fragments.

Travis CI failing

This is due to direct copying of .travis.yml file from open event android repo. The statement cd android should be removed.

Add tweet search feature

When a keyword is searched (using the magnifying lens icon in keyboard) in the EditText present in SuggestFragment or one of the suggested topic in RecyclerView is clicked, it should navigate to SearchFragment.

  • Obtain the JSON data of the search using search and display it in RecyclerView.
  • Create a separate RecyclerView adapter to display multiple images in a tweet.
  • Show different categories of tweets using filter parameter of search API endpoint. Tweets to be shown using TabLayout and ViewPager.
  • Add a floating action button that will redirect to TweetPosting activity (to be added later)

device-2017-06-07-115715

Handle orientation changes in Fragments

Handle orientation changes by saving the required state in Bundle and then restoring it back, in the following fragments:

  • TweetHarvestingFragment
  • SuggestFragment
  • SearchCategoryFragment

Add touch selectors for buttons.

Issue type: Enhancement

Short Description

Add touch selector for buttons present in TweetPostingFragment i.e. camera, gallery and location buttons. Adding touch selectors shows that a button is clicked and thus enhances UX.

Automatically build an apk file in the apk branch

The goal of this issue is to get an apk on each merged pull request build in the apk branch.

Use travis to build apks automatically. You can check other FOSSASIA projects e.g. Open Event Android and Susi Android how it is done there.

App Crashing

The app is crashing while running. It runs for 3-4 secs and then crashes.
LogCat

FATAL EXCEPTION: AsyncTask #2
Process: org.loklak.android.wok, PID: 23664
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:309)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    at java.lang.Thread.run(Thread.java:818)
 Caused by: java.lang.StringIndexOutOfBoundsException: length=22; regionStart=22; regionLength=-1
    at java.lang.String.startEndAndLength(String.java:298)
    at java.lang.String.substring(String.java:1087)
    at org.loklak.harvester.TwitterScraper$prop.<init>(Unknown Source)
    at org.loklak.harvester.TwitterScraper.search(Unknown Source)
    at org.loklak.harvester.TwitterScraper.search(Unknown Source)
    at org.loklak.android.wok.Harvester$LoadThread.doInBackground(Harvester.java:139)
    at org.loklak.android.wok.Harvester$LoadThread.doInBackground(Harvester.java:130)
    at android.os.AsyncTask$2.call(AsyncTask.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
    at java.lang.Thread.run(Thread.java:818) 

Need different Version

Cannot publish app. Error:

You need to use a different version code for your APK because you already have one with version code 1.

Add encrypted upload key and fastlane json to repo

For automatic publishing, upload key with fastlane JSON is to be added to the repo. This will include decryption script and modification in apk update script.

To better organize things, all files should be kept in scripts folder

Create a landing page for the app

Create a landing page for the app. The landing page of the app should have the following features:

  1. Screenshots of the app
  2. Features of the app
  3. Link to Google Play Store for installation.

Revert back package name to "org.loklak.android"

For beta release of the app:

  • Revert back the current package name to org.loklak.android, change the ui subpackage to wok and applicationId to org.loklak.android.wok in app/build.gradle file.
  • Add screenshot for splash screen.

Single Activity (of the same type) in the activity stack

Issue type: Bug

Short Description

When a new activity (Search, Suggest or Posting), the activity is added to activity back-stack irrespective of whether the same is activity is already present in the back-stack. Due to this unnecessary memory is used by the app.

Solution

The activities can be launched in singleTask launchMode.

Updating Documentation

Thinking of adding following in readme.md file :

  • Instructions to set up project locally
  • Road Map
  • Communication
  • Branch Policy
  • Code Style
  • Contribution Guidelines
  • Some Screenshots of current app.

@mariobehling Is there anything else required to be added?

Add welcome/intro screens

Showing welcoming screen when user first time opens the app

  1. Posting tweet from the app
  2. Default tweet cards

Update gradle, android studio gradle plugin target sdk and build tools to latest

Currently we have old versions most of which does not support new features like the new support libraries, instant run, faster build times etc.

It should be updated as follows
Gradle version: 2.3.2
Android studio gradle plugin version: 3.3
Traget sdk: 25
build tools: 25.0.3

Note: Travis configuration(.travis.yml) should also be updated

Add Twitter logout feature

Issue type: Enhancement

Short description:

Currently, the app doesn't allow the users to log out and log in with a different user account.

Required Enhancement

Add a fragment option for Log out, when clicked it will remove all the data present in SharedPreferences. That way, user can log in with a different account.

Fix docs for yaydoc

Description

The docs for this repo along with other loklak repositories will be generated as a single website using yaydoc.
Some changes are required so that the docs display properly on both github and yaydoc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.